Skip to content

Commit

Permalink
Add Mumbai
Browse files Browse the repository at this point in the history
  • Loading branch information
meezaan committed Jun 16, 2023
1 parent 3cf01d2 commit 4586300
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 17 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,28 @@ 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-mumbai:
needs: docker-build-and-push
runs-on: ubuntu-latest
container:
image: meezaan/kubectl:latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Update Consumer and Keys
run: |
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 }}
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
12 changes: 12 additions & 0 deletions .k8s/manifest-london.yml → .k8s/manifest-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ spec:
labels:
app: alquran-cloud-api-memcached
spec:
nodeSelector:
kubernetes.azure.com/scalesetpriority: "spot"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
tolerations:
- key: kubernetes.azure.com/scalesetpriority
operator: "Equal"
value: spot
effect: NoSchedule
containers:
- name: alquran-cloud-api-memcached
image: memcached:1.6
Expand Down Expand Up @@ -126,6 +133,11 @@ spec:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
tolerations:
- key: kubernetes.azure.com/scalesetpriority
operator: "Equal"
value: spot
effect: NoSchedule
containers:
- name: alquran-cloud-api
image: islamicnetwork/api.alquran.cloud:$COMMIT_TAG
Expand Down
27 changes: 13 additions & 14 deletions .k8s/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@ spec:
labels:
app: alquran-cloud-api-memcached
spec:
nodeSelector:
kubernetes.azure.com/scalesetpriority: "spot"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
tolerations:
- key: kubernetes.azure.com/scalesetpriority
operator: "Equal"
value: spot
effect: NoSchedule
containers:
- name: alquran-cloud-api-memcached
image: memcached:1.6
Expand Down Expand Up @@ -133,11 +126,6 @@ spec:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
tolerations:
- key: kubernetes.azure.com/scalesetpriority
operator: "Equal"
value: spot
effect: NoSchedule
containers:
- name: alquran-cloud-api
image: islamicnetwork/api.alquran.cloud:$COMMIT_TAG
Expand Down Expand Up @@ -223,7 +211,8 @@ spec:
tls:
- hosts:
- "api.alquran.cloud"
- "dubai.api.alquran.cloud"
- "london.api.alquran.cloud"
- "mumbai.api.alquran.cloud"
secretName: "alquran-cloud-api-tls"
rules:
- host: api.alquran.cloud
Expand All @@ -236,7 +225,17 @@ spec:
name: alquran-cloud-api
port:
number: 80
- host: dubai.api.alquran.cloud
- host: london.api.alquran.cloud
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: alquran-cloud-api
port:
number: 80
- host: mumbai.api.alquran.cloud
http:
paths:
- path: /
Expand Down

0 comments on commit 4586300

Please sign in to comment.