Skip to content

Commit

Permalink
feat: Add ability to specify initContainers (#305)
Browse files Browse the repository at this point in the history
* feat: Add ability to specify initContainers

* Update Chart.yaml

* fix: conditionals
  • Loading branch information
czuares authored Feb 20, 2025
1 parent e4fce6f commit 25f1b44
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 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.2
version: 8.11.3
version: 8.12.0
kubeVersion: '>= 1.21.0-0'
icon: https://zitadel.com/zitadel-logo-dark.svg
maintainers:
Expand Down
9 changes: 9 additions & 0 deletions charts/zitadel/templates/debug_replicaset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
enableServiceLinks: false
{{- if or .Values.zitadel.initContainers .Values.debug.initContainers }}
initContainers:
{{- with .Values.zitadel.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.zitadel.debug.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
{{- if .Values.zitadel.extraContainers }}
{{- toYaml .Values.zitadel.extraContainers | nindent 8 }}
Expand Down
7 changes: 6 additions & 1 deletion charts/zitadel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,12 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 14 }}
{{- if .Values.zitadel.selfSignedCert.enabled }}
{{- if or .Values.zitadel.selfSignedCert.enabled .Values.zitadel.initContainers}}
initContainers:
{{- with .Values.zitadel.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.zitadel.selfSignedCert.enabled }}
- name: generate-self-signed-cert
image: alpine/openssl
env:
Expand All @@ -227,6 +231,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- end }}
volumes:
- name: zitadel-config-yaml
configMap:
Expand Down
9 changes: 9 additions & 0 deletions charts/zitadel/templates/initjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
enableServiceLinks: false
restartPolicy: OnFailure
{{- if or .Values.zitadel.initContainers .Values.initJob.initContainers }}
initContainers:
{{- with .Values.zitadel.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.initJob.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
{{- if .Values.zitadel.extraContainers }}
{{- toYaml .Values.zitadel.extraContainers | nindent 8 }}
Expand Down
9 changes: 9 additions & 0 deletions charts/zitadel/templates/setupjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
enableServiceLinks: false
restartPolicy: OnFailure
{{- if or .Values.zitadel.initContainers .Values.setupJob.initContainers }}
initContainers:
{{- with .Values.zitadel.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.setupJob.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
{{- if .Values.zitadel.extraContainers }}
{{- toYaml .Values.zitadel.extraContainers | nindent 8 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/zitadel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ zitadel:
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-weight: "1"
initContainers: []
extraContainers: []

# initContainers allow you to add any init containers you wish to use globally.
# Additionally, they follow the same structure as extraContainers
initContainers: []
# 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: []
Expand Down Expand Up @@ -227,6 +231,7 @@ initJob:
resources: {}
backoffLimit: 5
activeDeadlineSeconds: 300
initContainers: []
extraContainers: []
podAnnotations: {}
podAdditionalLabels: {}
Expand All @@ -245,6 +250,7 @@ setupJob:
helm.sh/hook-weight: "2"
resources: {}
activeDeadlineSeconds: 300
initContainers: []
extraContainers: []
podAnnotations: {}
podAdditionalLabels: {}
Expand Down

0 comments on commit 25f1b44

Please sign in to comment.