Skip to content

Commit

Permalink
feat: Add ability to specify extraContainers (#287)
Browse files Browse the repository at this point in the history
* Add ability to specify extraContainers both globally and on specific deployments

* Bump chart version to 8.8.1

* Add trailing space to values for linting

* Linting fixes

* Fix comment verbiage

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
  • Loading branch information
PurseChicken and eliobischof authored Jan 7, 2025
1 parent e97a8e1 commit f716e52
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/zitadel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: zitadel
description: A Helm chart for ZITADEL
type: application
appVersion: v2.67.0
version: 8.10.0
version: 8.11.0
kubeVersion: '>= 1.21.0-0'
icon: https://zitadel.com/zitadel-logo-dark.svg
maintainers:
Expand Down
6 changes: 6 additions & 0 deletions charts/zitadel/templates/debug_replicaset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/zitadel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
9 changes: 6 additions & 3 deletions charts/zitadel/templates/initjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions charts/zitadel/templates/setupjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
43 changes: 43 additions & 0 deletions charts/zitadel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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:
# - 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

Expand Down Expand Up @@ -245,6 +285,9 @@ pdb:
# maxUnavailable: 1
annotations: {}

# extraContainers allows you to add any sidecar containers you wish to use in the Zitadel pod.
extraContainers: []

extraVolumes: []
# - name: ca-certs
# secret:
Expand Down

0 comments on commit f716e52

Please sign in to comment.