diff --git a/.github/workflows/cd-dev.yaml b/.github/workflows/cd-dev.yaml index 6cfe0f93..8b1f99bd 100644 --- a/.github/workflows/cd-dev.yaml +++ b/.github/workflows/cd-dev.yaml @@ -77,6 +77,7 @@ jobs: - name: Write values.yaml file run: | cat << EOF > values.yaml + environment: "development" api: name: "api-development" image: diff --git a/.github/workflows/cd-prod.yaml b/.github/workflows/cd-prod.yaml index 7b24cfa7..0faa618c 100644 --- a/.github/workflows/cd-prod.yaml +++ b/.github/workflows/cd-prod.yaml @@ -51,6 +51,7 @@ jobs: - name: Write values.yaml file run: | cat << EOF > values.yaml + environment: "prod" api: name: "api-prod" image: diff --git a/.github/workflows/cd-staging.yaml b/.github/workflows/cd-staging.yaml index 420e2931..d12e2a4e 100644 --- a/.github/workflows/cd-staging.yaml +++ b/.github/workflows/cd-staging.yaml @@ -51,6 +51,7 @@ jobs: - name: Write values.yaml file run: | cat << EOF > values.yaml + environment: "staging" api: name: "api-staging" image: diff --git a/charts/basedosdados-api/templates/deployment.yaml b/charts/basedosdados-api/templates/deployment.yaml index 2a3cb54d..f40c079f 100644 --- a/charts/basedosdados-api/templates/deployment.yaml +++ b/charts/basedosdados-api/templates/deployment.yaml @@ -30,6 +30,10 @@ spec: - name: basedosdados-api image: "{{ .Values.api.image.name }}:{{ .Values.api.image.tag }}" imagePullPolicy: {{ .Values.api.image.pullPolicy }} + volumeMounts: + - mountPath: /var/secrets/ + name: gcp-sa + readOnly: true ports: - name: http containerPort: 80 @@ -79,3 +83,10 @@ spec: timeoutSeconds: 5 failureThreshold: 5 successThreshold: 1 + volumes: + - name: gcp-sa + secret: + secretName: api-{{ .Values.environment }}-secrets + items: + - key: GCP_SA + path: gcp-sa.json