From 62ddc3dc4b00228837ae41d0df585ed80130cb16 Mon Sep 17 00:00:00 2001 From: Ashin Sabu <139749674+ashinsabu3@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:29:34 +0530 Subject: [PATCH] feat: [CDS-97420]: add reference to argocd redis secret (#33) --- templates/gitops-agent/deployment.yaml | 29 ++++++++++++++++++++++++++ values.yaml | 16 ++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/templates/gitops-agent/deployment.yaml b/templates/gitops-agent/deployment.yaml index 0471b84..2fb042b 100755 --- a/templates/gitops-agent/deployment.yaml +++ b/templates/gitops-agent/deployment.yaml @@ -74,6 +74,35 @@ spec: name: {{ .Values.agent.name }} - secretRef: name: {{ .Values.agent.name }} + env: + - name: REDIS_USERNAME + valueFrom: + secretKeyRef: + name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }} + key: redis-username + optional: true + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }} + {{- if .Values.externalRedis.host }} + key: redis-password + optional: true + {{- else }} + key: auth + {{- end }} + - name: REDIS_SENTINEL_USERNAME + valueFrom: + secretKeyRef: + name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }} + key: redis-sentinel-username + optional: true + - name: REDIS_SENTINEL_PASSWORD + valueFrom: + secretKeyRef: + name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }} + key: redis-sentinel-password + optional: true volumeMounts: {{- with .Values.agent.volumeMounts }} {{- toYaml . | nindent 8 }} diff --git a/values.yaml b/values.yaml index 4b52baf..9acb498 100644 --- a/values.yaml +++ b/values.yaml @@ -553,3 +553,19 @@ controller: redis: name: redis + +# External Redis parameters +externalRedis: + # -- External Redis server host + host: "" + # -- External Redis username + username: "" + # -- External Redis password + password: "" + # -- External Redis server port + port: 6379 + # -- The name of an existing secret with Redis (must contain key `redis-password`) and Sentinel credentials. + # When it's set, the `externalRedis.password` parameter is ignored + existingSecret: "" + # -- External Redis Secret annotations + secretAnnotations: {}