From dc737b45892f526802b95b87cc3b9bba91da9e3a Mon Sep 17 00:00:00 2001 From: Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram Date: Fri, 16 Jun 2023 11:29:38 +0400 Subject: [PATCH] Add mumbai --- .github/workflows/build-docker-image.yml | 40 +++++++++---------- .../{manifest-london.yml => manifest-aks.yml} | 5 +++ .k8s/manifest.yml | 5 --- 3 files changed, 25 insertions(+), 25 deletions(-) rename .k8s/{manifest-london.yml => manifest-aks.yml} (96%) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 8e052cd..96845e5 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -49,29 +49,29 @@ jobs: export REF_NAME=${{ github.ref_name }} COMMIT_TAG=$REF_NAME export COMMIT_TAG=$REF_NAME - envsubst <./.k8s/manifest-london.yml >./.k8s/manifest-london.yml.out - mv ./.k8s/manifest-london.yml.out ./.k8s/manifest-london.yml - kubectl apply -f .k8s/manifest-london.yml --kubeconfig=/dev/null --server=$K8S_URL --certificate-authority=cert.crt --token=$K8S_TOKEN + envsubst <./.k8s/manifest.yml >./.k8s/manifest.yml.out + mv ./.k8s/manifest.yml.out ./.k8s/manifest.yml + kubectl apply -f .k8s/manifest.yml --kubeconfig=/dev/null --server=$K8S_URL --certificate-authority=cert.crt --token=$K8S_TOKEN - - deploy-dubai: + deploy-mumbai: needs: docker-build-and-push runs-on: ubuntu-latest + container: + image: meezaan/kubectl:latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install Env Substring - run: sudo apt-get update && sudo apt-get -y install gettext-base - - name: Install Kubectl - run: | - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl - chmod u+x ./kubectl - - name: Deploy + - name: Check out repository code + uses: actions/checkout@v3 + - name: Update Consumer and Keys run: | - curl -o ./.k8s/deploy.sh https://raw.githubusercontent.com/islamic-network/k8s-deployment/master/deploy.sh - chmod u+x ./.k8s/deploy.sh + export K8S_URL=${{ secrets.K8S_MUMBAI_URL }} + export K8S_TOKEN=${{ secrets.K8S_MUMBAI_TOKEN }} + export K8S_CA=${{ secrets.K8S_MUMBAI_CA }} + echo "$K8S_CA" | base64 --decode > cert.crt export REF_NAME=${{ github.ref_name }} - export K8S_URL=${{ secrets.K8S_DUBAI_URL }} - export K8S_TOKEN=${{ secrets.K8S_DUBAI_TOKEN }} - export K8S_CA=${{ secrets.K8S_DUBAI_CA }} - sh ./.k8s/deploy.sh + COMMIT_TAG=$REF_NAME + export COMMIT_TAG=$REF_NAME + envsubst <./.k8s/manifest.yml >./.k8s/manifest.yml.out + mv ./.k8s/manifest.yml.out ./.k8s/manifest.yml + kubectl apply -f .k8s/manifest.yml --kubeconfig=/dev/null --server=$K8S_URL --certificate-authority=cert.crt --token=$K8S_TOKEN + + diff --git a/.k8s/manifest-london.yml b/.k8s/manifest-aks.yml similarity index 96% rename from .k8s/manifest-london.yml rename to .k8s/manifest-aks.yml index cf7252a..714578c 100644 --- a/.k8s/manifest-london.yml +++ b/.k8s/manifest-aks.yml @@ -24,6 +24,11 @@ spec: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: ScheduleAnyway + tolerations: + - key: kubernetes.azure.com/scalesetpriority + operator: "Equal" + value: spot + effect: NoSchedule containers: - name: apache-exporter-sidecar image: lusotycoon/apache-exporter diff --git a/.k8s/manifest.yml b/.k8s/manifest.yml index 714578c..cf7252a 100644 --- a/.k8s/manifest.yml +++ b/.k8s/manifest.yml @@ -24,11 +24,6 @@ spec: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: ScheduleAnyway - tolerations: - - key: kubernetes.azure.com/scalesetpriority - operator: "Equal" - value: spot - effect: NoSchedule containers: - name: apache-exporter-sidecar image: lusotycoon/apache-exporter