From 050d6fe05fe9415276d35c5d50c215ee80ba958a Mon Sep 17 00:00:00 2001 From: PurseChicken Date: Sat, 14 Dec 2024 13:29:39 -0800 Subject: [PATCH 1/5] Add ability to specify extraContainers both globally and on specific deployments --- .../zitadel/templates/debug_replicaset.yaml | 6 +++ charts/zitadel/templates/deployment.yaml | 6 +++ charts/zitadel/templates/initjob.yaml | 9 ++-- charts/zitadel/templates/setupjob.yaml | 9 ++-- charts/zitadel/values.yaml | 45 ++++++++++++++++++- 5 files changed, 68 insertions(+), 7 deletions(-) diff --git a/charts/zitadel/templates/debug_replicaset.yaml b/charts/zitadel/templates/debug_replicaset.yaml index 38794ff..4cf81ce 100644 --- a/charts/zitadel/templates/debug_replicaset.yaml +++ b/charts/zitadel/templates/debug_replicaset.yaml @@ -32,6 +32,12 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} enableServiceLinks: false containers: + {{- if .Values.zitadel.extraContainers }} + {{- toYaml .Values.zitadel.extraContainers | nindent 8 }} + {{- end }} + {{- if .Values.zitadel.debug.extraContainers }} + {{- toYaml .Values.zitadel.debug.extraContainers | nindent 8 }} + {{- end }} - name: "{{ .Chart.Name }}-debug" securityContext: {{- toYaml .Values.securityContext | nindent 14 }} diff --git a/charts/zitadel/templates/deployment.yaml b/charts/zitadel/templates/deployment.yaml index 73c6df8..f48fa62 100644 --- a/charts/zitadel/templates/deployment.yaml +++ b/charts/zitadel/templates/deployment.yaml @@ -39,6 +39,12 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} enableServiceLinks: false containers: + {{- if .Values.zitadel.extraContainers }} + {{- toYaml .Values.zitadel.extraContainers | nindent 8 }} + {{- end }} + {{- if .Values.extraContainers }} + {{- toYaml .Values.extraContainers | nindent 8 }} + {{- end }} - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 14 }} diff --git a/charts/zitadel/templates/initjob.yaml b/charts/zitadel/templates/initjob.yaml index 1516982..8495b30 100644 --- a/charts/zitadel/templates/initjob.yaml +++ b/charts/zitadel/templates/initjob.yaml @@ -36,6 +36,12 @@ spec: enableServiceLinks: false restartPolicy: OnFailure containers: + {{- if .Values.zitadel.extraContainers }} + {{- toYaml .Values.zitadel.extraContainers | nindent 8 }} + {{- end }} + {{- if .Values.initJob.extraContainers }} + {{- toYaml .Values.initJob.extraContainers | nindent 8 }} + {{- end }} - name: "{{ .Chart.Name }}-init" securityContext: {{- toYaml .Values.securityContext | nindent 14 }} @@ -127,9 +133,6 @@ spec: {{- end }} resources: {{- toYaml .Values.initJob.resources | nindent 14 }} - {{- if .Values.initJob.extraContainers }} - {{- toYaml .Values.initJob.extraContainers | nindent 8 }} - {{- end }} volumes: - name: zitadel-config-yaml configMap: diff --git a/charts/zitadel/templates/setupjob.yaml b/charts/zitadel/templates/setupjob.yaml index 60ba267..d82af60 100644 --- a/charts/zitadel/templates/setupjob.yaml +++ b/charts/zitadel/templates/setupjob.yaml @@ -38,6 +38,12 @@ spec: enableServiceLinks: false restartPolicy: OnFailure containers: + {{- if .Values.zitadel.extraContainers }} + {{- toYaml .Values.zitadel.extraContainers | nindent 8 }} + {{- end }} + {{- if .Values.setupJob.extraContainers }} + {{- toYaml .Values.setupJob.extraContainers | nindent 8 }} + {{- end }} - name: "{{ .Chart.Name }}-setup" securityContext: {{- toYaml .Values.securityContext | nindent 14 }} @@ -152,9 +158,6 @@ spec: {{- toYaml .Values.setupJob.resources | nindent 12 }} {{- end }} {{- end }} - {{- if .Values.setupJob.extraContainers }} - {{- toYaml .Values.setupJob.extraContainers | nindent 8 }} - {{- end }} volumes: - name: zitadel-config-yaml configMap: diff --git a/charts/zitadel/values.yaml b/charts/zitadel/values.yaml index d68b6c1..3e6d75a 100644 --- a/charts/zitadel/values.yaml +++ b/charts/zitadel/values.yaml @@ -73,6 +73,46 @@ zitadel: annotations: helm.sh/hook: pre-install,pre-upgrade helm.sh/hook-weight: "1" + extraContainers: [] + + # extraContainers allows you to add any sidecar containers you wish to use to all deployments. + # Currently this is the Zitadel Deployment, Setup Job**, Init Job** and debug_replicaset** **If Enabled + extraContainers: [] + # # Example; You wish to deploy a cloud-sql-proxy sidecar to all deployments: + # - name: cloud-sql-proxy + # image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.1 + # command: + # - /cloud-sql-proxy + # args: + # - my-project:my-region:my-instance + # - --port=5432 + # - --auto-iam-authn + # - --health-check + # - "--http-address=0.0.0.0" + # ports: + # - containerPort: 5432 + # startupProbe: + # httpGet: + # path: /startup + # port: 9090 + # periodSeconds: 1 + # timeoutSeconds: 5 + # livenessProbe: + # httpGet: + # path: /liveness + # port: 9090 + # initialDelaySeconds: 0 + # periodSeconds: 60 + # timeoutSeconds: 30 + # failureThreshold: 5 + # securityContext: + # runAsNonRoot: true + # readOnlyRootFilesystem: true + # allowPrivilegeEscalation: false + # lifecycle: + # postStart: + # exec: + # command: ["/cloud-sql-proxy", "wait"] replicaCount: 3 @@ -242,6 +282,9 @@ pdb: # maxUnavailable: 1 annotations: {} +# extraContainers allows you to add any sidecar containers you wish to use to the Zitadel Deployment +extraContainers: [] + extraVolumes: [] # - name: ca-certs # secret: @@ -263,4 +306,4 @@ extraManifests: [] # name: {{ include "zitadel.fullname" . }}-my-secret # stringData: # key: value - # type: Opaque + # type: Opaque \ No newline at end of file From 3ec5af7b48b12e75fab194511652186738a80edb Mon Sep 17 00:00:00 2001 From: PurseChicken Date: Sat, 14 Dec 2024 14:34:45 -0800 Subject: [PATCH 2/5] Bump chart version to 8.8.1 --- charts/zitadel/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/zitadel/Chart.yaml b/charts/zitadel/Chart.yaml index 08fe770..5e6b68d 100644 --- a/charts/zitadel/Chart.yaml +++ b/charts/zitadel/Chart.yaml @@ -3,7 +3,7 @@ name: zitadel description: A Helm chart for ZITADEL type: application appVersion: v2.66.0 -version: 8.8.0 +version: 8.8.1 kubeVersion: '>= 1.21.0-0' icon: https://zitadel.com/zitadel-logo-dark.svg maintainers: From a84d3f7d4f452d8f8e0bb56a20df03424f4795df Mon Sep 17 00:00:00 2001 From: PurseChicken Date: Sat, 14 Dec 2024 14:49:49 -0800 Subject: [PATCH 3/5] Add trailing space to values for linting --- charts/zitadel/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/zitadel/values.yaml b/charts/zitadel/values.yaml index 3e6d75a..13abe33 100644 --- a/charts/zitadel/values.yaml +++ b/charts/zitadel/values.yaml @@ -306,4 +306,5 @@ extraManifests: [] # name: {{ include "zitadel.fullname" . }}-my-secret # stringData: # key: value - # type: Opaque \ No newline at end of file + # type: Opaque + \ No newline at end of file From 6289a57c6f0bcf168111a3cb2ad30b61991a4cb5 Mon Sep 17 00:00:00 2001 From: PurseChicken Date: Sat, 14 Dec 2024 14:57:36 -0800 Subject: [PATCH 4/5] Linting fixes --- charts/zitadel/values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/zitadel/values.yaml b/charts/zitadel/values.yaml index 13abe33..d20a263 100644 --- a/charts/zitadel/values.yaml +++ b/charts/zitadel/values.yaml @@ -79,7 +79,7 @@ zitadel: # Currently this is the Zitadel Deployment, Setup Job**, Init Job** and debug_replicaset** **If Enabled extraContainers: [] # # Example; You wish to deploy a cloud-sql-proxy sidecar to all deployments: - # - name: cloud-sql-proxy + # - name: cloud-sql-proxy # image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.1 # command: # - /cloud-sql-proxy @@ -307,4 +307,3 @@ extraManifests: [] # stringData: # key: value # type: Opaque - \ No newline at end of file From e0b295c8265393061f8a061c97a201102a24ca5f Mon Sep 17 00:00:00 2001 From: PurseChicken Date: Sat, 14 Dec 2024 15:27:46 -0800 Subject: [PATCH 5/5] Fix comment verbiage --- charts/zitadel/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/zitadel/values.yaml b/charts/zitadel/values.yaml index d20a263..6a9ab2b 100644 --- a/charts/zitadel/values.yaml +++ b/charts/zitadel/values.yaml @@ -75,7 +75,7 @@ zitadel: helm.sh/hook-weight: "1" extraContainers: [] - # extraContainers allows you to add any sidecar containers you wish to use to all deployments. + # extraContainers allows you to add any sidecar containers you wish to use globally. # Currently this is the Zitadel Deployment, Setup Job**, Init Job** and debug_replicaset** **If Enabled extraContainers: [] # # Example; You wish to deploy a cloud-sql-proxy sidecar to all deployments: @@ -282,7 +282,7 @@ pdb: # maxUnavailable: 1 annotations: {} -# extraContainers allows you to add any sidecar containers you wish to use to the Zitadel Deployment +# extraContainers allows you to add any sidecar containers you wish to use in the Zitadel pod. extraContainers: [] extraVolumes: []