Skip to content

Commit e1d4632

Browse files
committed
add support to override redis image, add support to create argocd-secret with key server.secretKey
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
1 parent d4c6f26 commit e1d4632

3 files changed

Lines changed: 55 additions & 6 deletions

File tree

install/helm-repo/argocd-agent-agent/templates/NOTES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ Configuration overview
4646
Bundled Argo CD
4747
---------------
4848
This release includes the argo-cd subchart. Configure it under the `argocd` values key. Upgrades and rollbacks apply to the agent and Argo CD together.
49+
50+
The argocd-secret is managed by this chart with an auto-generated
51+
server.secretkey. The key is preserved across upgrades. To set your own:
52+
--set argocd.configs.secret.extra.server\.secretkey=YOUR-KEY
4953
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if .Values.argoCD.enabled }}
2+
{{- $ns := include "argo-cd.namespace" . }}
3+
{{- $secretName := "argocd-secret" }}
4+
{{- $extra := .Values.argocd.configs.secret.extra | default dict }}
5+
{{- $explicitKey := index $extra "server.secretkey" | default "" }}
6+
{{- $serverSecretKey := "" }}
7+
{{- if $explicitKey }}
8+
{{- $serverSecretKey = $explicitKey }}
9+
{{- else }}
10+
{{- $existingSecret := lookup "v1" "Secret" $ns $secretName }}
11+
{{- if and $existingSecret $existingSecret.data }}
12+
{{- $encodedKey := index $existingSecret.data "server.secretkey" }}
13+
{{- if $encodedKey }}
14+
{{- $serverSecretKey = $encodedKey | b64dec }}
15+
{{- end }}
16+
{{- end }}
17+
{{- if not $serverSecretKey }}
18+
{{- $serverSecretKey = randAlphaNum 20 }}
19+
{{- end }}
20+
{{- end }}
21+
apiVersion: v1
22+
kind: Secret
23+
metadata:
24+
name: {{ $secretName }}
25+
namespace: {{ $ns }}
26+
labels:
27+
{{- include "argocd-agent-agent.labels" . | nindent 4 }}
28+
app.kubernetes.io/component: argocd-secret
29+
type: Opaque
30+
data:
31+
server.secretkey: {{ $serverSecretKey | b64enc }}
32+
{{- range $key, $value := $extra }}
33+
{{- if ne $key "server.secretkey" }}
34+
{{ $key }}: {{ $value | b64enc }}
35+
{{- end }}
36+
{{- end }}
37+
{{- end }}

install/helm-repo/argocd-agent-agent/values.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,22 @@ argocd:
3030
# -- Disable the Argo CD notifications controller (`notifications.enabled` in argo-helm).
3131
notifications:
3232
enabled: false
33+
redis:
34+
image:
35+
# -- Redis image repository (change for a private or custom registry mirror).
36+
repository: ecr-public.aws.com/docker/library/redis
37+
# -- Redis image tag.
38+
tag: 8.2.3-alpine
39+
repoServer:
40+
copyutil:
41+
# -- Clear default copyutil extra args to avoid issues when repo-server is bundled.
42+
extraArgs: ""
3343
configs:
3444
secret:
35-
# -- Seed the Argo CD server secret key so the application controller can
36-
# decrypt cluster credentials even when the Argo CD server is not running
37-
# (server.replicas=0). Override with a stable random value in production;
38-
# the default is intentionally non-empty so the chart works out of the box.
39-
extra:
40-
server.secretkey: "CHANGE-ME-generate-a-random-secret-key"
45+
# -- Disable subchart's argocd-secret creation; the parent chart manages
46+
# it with an auto-generated server.secretkey (see templates/argocd-secret.yaml).
47+
createSecret: false
48+
extra: {}
4149

4250
## @section Global
4351
# -- (Deprecated: use global.namespaceOverride) Override namespace for the agent chart only.

0 commit comments

Comments
 (0)