From 012f277c31668d3278fe9fcbe010c08d4aecc29d Mon Sep 17 00:00:00 2001 From: Piotr Karpala Date: Mon, 10 Jun 2024 21:54:13 -0400 Subject: [PATCH] Support for Azure Workload Identity in Cosmos DB External Scaler Signed-off-by: Piotr Karpala --- .../templates/scaler-deployment.yaml | 6 ++++++ external-scaler-azure-cosmos-db/values.yaml | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/external-scaler-azure-cosmos-db/templates/scaler-deployment.yaml b/external-scaler-azure-cosmos-db/templates/scaler-deployment.yaml index 0fad79ce..3d221140 100644 --- a/external-scaler-azure-cosmos-db/templates/scaler-deployment.yaml +++ b/external-scaler-azure-cosmos-db/templates/scaler-deployment.yaml @@ -14,6 +14,9 @@ spec: metadata: labels: {{- include "external-scaler-azure-cosmos-db.labels" . | indent 8 }} + {{- if .Values.podIdentity.azureWorkload.enabled }} + azure.workload.identity/use: "true" + {{- end }} spec: containers: - name: {{ .Chart.Name }} @@ -25,3 +28,6 @@ spec: resources: {{- .Values.resources | toYaml | nindent 12 }} terminationGracePeriodSeconds: 10 + {{- if .Values.serviceAccount.name }} + serviceAccountName: {{ .Values.serviceAccount.name }} + {{- end }} diff --git a/external-scaler-azure-cosmos-db/values.yaml b/external-scaler-azure-cosmos-db/values.yaml index 77c7c1f8..45a27194 100644 --- a/external-scaler-azure-cosmos-db/values.yaml +++ b/external-scaler-azure-cosmos-db/values.yaml @@ -24,3 +24,14 @@ resources: limits: cpu: 100m memory: 512Mi + +podIdentity: + azureWorkload: + # -- Set to true to enable Azure Workload Identity usage. + # See https://keda.sh/docs/concepts/authentication/#azure-workload-identity + # This will be set as a label on the deployment. + enabled: false + +serviceAccount: + # -- The name of the service account to use. + name: "" \ No newline at end of file