diff --git a/helm/charts/kratos/templates/deployment.yaml b/helm/charts/kratos/templates/deployment.yaml index b17b8e464..1c5878c2b 100644 --- a/helm/charts/kratos/templates/deployment.yaml +++ b/helm/charts/kratos/templates/deployment.yaml @@ -36,8 +36,12 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - {{- if .Values.kratos.autoMigrate }} + {{- if or .Values.kratos.autoMigrate .Values.deployment.extraInitContainers}} initContainers: + {{- if .Values.deployment.extraInitContainers }} +{{ tpl .Values.deployment.extraInitContainers . | indent 8 }} + {{- end }} + {{- if .Values.kratos.autoMigrate }} - name: {{ .Chart.Name }}-automigrate image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -107,6 +111,7 @@ spec: - secretRef: name: {{ .Values.deployment.environmentSecretsName }} {{- end}} + {{- end}} {{- end}} volumes: {{- if .Values.deployment.extraVolumes }} diff --git a/helm/charts/kratos/values.yaml b/helm/charts/kratos/values.yaml index 1959c14ee..733ae6f9c 100644 --- a/helm/charts/kratos/values.yaml +++ b/helm/charts/kratos/values.yaml @@ -196,6 +196,11 @@ deployment: # mountPath: "/etc/postgresql-tls" # readOnly: true + # If you want to add extra init containers. These are processed before the migration init container. + # extraInitContainers: | + # - name: ... + # image: ... + annotations: {} # If you do want to specify annotations, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'annotations:'.