Skip to content

Commit

Permalink
Add prod to deploy workflow (#189)
Browse files Browse the repository at this point in the history
* add prod to workflows and create azure secrets

* add secrets yaml for azure

* correct name for secrets yaml

* correct the name again

* add pipe

* change the command for create azure secrets step
  • Loading branch information
LavMatt authored Jul 11, 2024
1 parent 486a9fb commit 467087d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
postgres_client_host: ${{ secrets.POSTGRES_CLIENT_HOST }}
postgres_url: ${{ secrets.POSTGRES_URL }}
opensearch_proxy_host: ${{ secrets.OPENSEARCH_PROXY_HOST }}
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}
20 changes: 20 additions & 0 deletions .github/workflows/deploy-staged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
postgres_client_host: ${{ secrets.POSTGRES_CLIENT_HOST }}
postgres_url: ${{ secrets.POSTGRES_URL }}
opensearch_proxy_host: ${{ secrets.OPENSEARCH_PROXY_HOST }}
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}

deploy-preprod:
uses: ./.github/workflows/deploy-workflow.yml
Expand All @@ -43,3 +44,22 @@ jobs:
postgres_client_host: ${{ secrets.POSTGRES_CLIENT_HOST }}
postgres_url: ${{ secrets.POSTGRES_URL }}
opensearch_proxy_host: ${{ secrets.OPENSEARCH_PROXY_HOST }}
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}

deploy-prod:
uses: ./.github/workflows/deploy-workflow.yml
needs: [deploy-preprod]
with:
env: prod
datahub_helm_version: "0.4.9"
datahub_prereqs_helm_version: "0.1.10"
secrets:
kube_namespace: "${{ secrets.KUBE_NAMESPACE }}"
kube_cert: "${{ secrets.KUBE_CERT }}"
kube_cluster: "${{ secrets.KUBE_CLUSTER }}"
kube_token: "${{ secrets.KUBE_TOKEN }}"
postgres_host: ${{ secrets.POSTGRES_HOST}}
postgres_client_host: ${{ secrets.POSTGRES_CLIENT_HOST }}
postgres_url: ${{ secrets.POSTGRES_URL }}
opensearch_proxy_host: ${{ secrets.OPENSEARCH_PROXY_HOST }}
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}
14 changes: 14 additions & 0 deletions .github/workflows/deploy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ on:
opensearch_proxy_host:
description: "domain address to reach opensearch"
required: true
azure_client_secret:
description: "client secret for azure authentication"
required: true

concurrency:
group: ${{ inputs.env }}
Expand Down Expand Up @@ -183,6 +186,17 @@ jobs:
envsubst < helm_deploy/monitoring/datahub-networkpolicy.yaml |
kubectl apply -f - --namespace=${KUBE_NAMESPACE}
- name: create azure k8s secrets
shell: bash
env:
KUBE_NAMESPACE: ${{ secrets.kube_namespace }}
AZURE_CLIENT_ID: ${{ vars.CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
TENANT_ID: ${{ vars.TENANT_ID }}
run: |
envsubst < helm_deploy/secrets.yaml |
kubectl -n ${KUBE_NAMESPACE} apply -f -
- name: update grafana status dashboard configmap
if: ${{ inputs.env == 'dev' }}
shell: bash
Expand Down
9 changes: 9 additions & 0 deletions helm_deploy/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: "azure-secrets"
type: Opaque
stringData:
client_id: "${AZURE_CLIENT_ID}"
client_secret: "${AZURE_CLIENT_SECRET}"
tenant_id: "${TENANT_ID}"

0 comments on commit 467087d

Please sign in to comment.