diff --git a/helm/templates/api/deployment.yaml b/helm/templates/api/deployment.yaml index ca9e062..3cdd18d 100644 --- a/helm/templates/api/deployment.yaml +++ b/helm/templates/api/deployment.yaml @@ -27,6 +27,9 @@ spec: labels: app: {{ include "ifrcgo-alert-hub.fullname" . }} component: api + {{- if .Values.serviceAccount.create }} + azure.workload.identity/use: "true" + {{- end }} spec: containers: - name: api diff --git a/helm/templates/argo-hooks/hook-job.yaml b/helm/templates/argo-hooks/hook-job.yaml index bd9b35f..5cd6de3 100644 --- a/helm/templates/argo-hooks/hook-job.yaml +++ b/helm/templates/argo-hooks/hook-job.yaml @@ -15,6 +15,11 @@ metadata: argocd.argoproj.io/hook: {{ $hook.hook }} spec: template: + metadata: + labels: + {{- if $.Values.serviceAccount.create }} + azure.workload.identity/use: "true" + {{- end }} spec: restartPolicy: "Never" containers: @@ -37,6 +42,10 @@ spec: - configMapRef: name: {{ template "ifrcgo-alert-hub.fullname" $ }}-api-configmap + {{- if $.Values.serviceAccount.create }} + serviceAccountName: {{ include "ifrcgo-alert-hub.serviceAccountName" $ }} + {{- end }} + {{- with $.Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/helm/templates/worker/deployment.yaml b/helm/templates/worker/deployment.yaml index 8da8ccd..4028f6a 100644 --- a/helm/templates/worker/deployment.yaml +++ b/helm/templates/worker/deployment.yaml @@ -33,6 +33,9 @@ spec: app: {{ include "ifrcgo-alert-hub.fullname" $ }} component: worker queue: {{ $queue_name }} + {{- if $.Values.serviceAccount.create }} + azure.workload.identity/use: "true" + {{- end }} spec: containers: - name: worker @@ -52,6 +55,10 @@ spec: - configMapRef: name: {{ template "ifrcgo-alert-hub.fullname" $ }}-api-configmap + {{- if $.Values.serviceAccount.create }} + serviceAccountName: {{ include "ifrcgo-alert-hub.serviceAccountName" $ }} + {{- end }} + {{- with $.Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }}