1
+ {{- if .Values.zitadel.debug.enabled }}
2
+ apiVersion : apps/v1
3
+ kind : ReplicaSet
4
+ metadata :
5
+ name : " {{ include " zitadel.fullname" . }}-debug"
6
+ labels :
7
+ app.kubernetes.io/component : debug
8
+ {{- with .Values.zitadel.debug.annotations }}
9
+ annotations :
10
+ {{- toYaml . | nindent 4 }}
11
+ {{- end }}
12
+ spec :
13
+ replicas : 1
14
+ selector :
15
+ matchLabels :
16
+ {{- include "zitadel.debugSelectorLabels" . | nindent 6 }}
17
+ template :
18
+ metadata :
19
+ annotations :
20
+ checksum/configmap : {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
21
+ checksum/secret-db-ssl-root-crt : {{ include (print $.Template.BasePath "/secret_db-ssl-root-crt.yaml") . | sha256sum }}
22
+ checksum/secret-zitadel-secrets : {{ include (print $.Template.BasePath "/secret_zitadel-secrets.yaml") . | sha256sum }}
23
+ labels :
24
+ {{- include "zitadel.debugSelectorLabels" . | nindent 8 }}
25
+ spec :
26
+ {{- with .Values.imagePullSecrets }}
27
+ imagePullSecrets :
28
+ {{- toYaml . | nindent 8 }}
29
+ {{- end }}
30
+ serviceAccountName : {{ include "zitadel.serviceAccountName" . }}
31
+ securityContext :
32
+ {{- toYaml .Values.podSecurityContext | nindent 8 }}
33
+ enableServiceLinks : false
34
+ containers :
35
+ - name : " {{ .Chart.Name }}-debug"
36
+ securityContext :
37
+ {{- toYaml .Values.securityContext | nindent 14 }}
38
+ image : " {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}-debug"
39
+ imagePullPolicy : {{ .Values.image.pullPolicy }}
40
+ command : [ "/bin/bash", "-c", 'echo "You can now open a shell within this pod by running the following command:"; echo ""; echo "kubectl --namespace {{ .Release.Namespace }} exec -it ${HOSTNAME} -- bash"; echo ""; echo "Check the directories /config and /.secrets for ZITADEL config files"; echo "also check the ZITADEL_ prefixed environment variables"; echo "For zitadel commands that need the masterkey, pass the flag --masterkeyFromEnv"; echo "this pod completes automatically in a day"; echo "Make sure you set zitadel.debug.enabled to false and upgrade the release when you are done"; echo "Also, delete the debug pods replica set by running the following command:"; echo; echo "kubectl --namespace {{ .Release.Namespace }} delete replicaset {{ include "zitadel.fullname" . }}-debug"; sleep 86400' ]
41
+ env :
42
+ - name : ZITADEL_MASTERKEY
43
+ valueFrom :
44
+ secretKeyRef :
45
+ name : {{ default "zitadel-masterkey" .Values.zitadel.masterkeySecretName }}
46
+ key : masterkey
47
+ - name : ZITADEL_FIRSTINSTANCE_MACHINEKEYPATH
48
+ value : " /machinekey/sa.json"
49
+ {{- $dbEnv := get (include "zitadel.dbkey.json" . | fromJson) "env" }}
50
+ {{- if (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) }}
51
+ - name : ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_ROOTCERT
52
+ value : /.secrets/db-ssl-ca-crt/ca.crt
53
+ {{- end }}
54
+ {{- if .Values.zitadel.dbSslUserCrtSecret }}
55
+ - name : ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_CERT
56
+ value : /.secrets/db-ssl-user-crt/tls.crt
57
+ - name : ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_KEY
58
+ value : /.secrets/db-ssl-user-crt/tls.key
59
+ {{- end}}
60
+ {{- with .Values.env }}
61
+ {{- toYaml . | nindent 12 }}
62
+ {{- end }}
63
+ volumeMounts :
64
+ - name : zitadel-config-yaml
65
+ mountPath : /config
66
+ - name : chowned-secrets
67
+ mountPath : /.secrets
68
+ {{- if or .Values.zitadel.secretConfig .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret .Values.zitadel.dbSslUserCrtSecret .Values.zitadel.configSecretName }}
69
+ initContainers :
70
+ - args :
71
+ - " {{ include " zitadel.joincpcommands" (dict "commands" (list
72
+ (include "zitadel.makecpcommand" (dict "value" .Values.zitadel.secretConfig "path" "/zitadel-secrets-yaml/" ))
73
+ (include "zitadel.makecpcommand" (dict "value" .Values.zitadel.configSecretName "path" "/zitadel-secret-config-yaml/" ))
74
+ (include "zitadel.makecpcommand" (dict "value" (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) "path" "/db-ssl-ca-crt/" ))
75
+ (include "zitadel.makecpcommand" (dict "value" .Values.zitadel.dbSslUserCrtSecret "path" "/db-ssl-user-crt/" ))
76
+ )) }} chown -R 1000:1000 /chowned-secrets/ && find /chowned-secrets/ -type f -exec chmod 400 -- {} + "
77
+ command :
78
+ - sh
79
+ - -c
80
+ image : " {{ .Values.chownImage.repository }}:{{ .Values.chownImage.tag }}"
81
+ imagePullPolicy : {{ .Values.chownImage.pullPolicy }}
82
+ name : chown
83
+ volumeMounts :
84
+ - name : chowned-secrets
85
+ mountPath : /chowned-secrets
86
+ {{- if .Values.zitadel.secretConfig }}
87
+ - name : zitadel-secrets-yaml
88
+ mountPath : /zitadel-secrets-yaml
89
+ {{- end }}
90
+ {{- if .Values.zitadel.configSecretName }}
91
+ - name : zitadel-secret-config-yaml
92
+ mountPath : /zitadel-secret-config-yaml
93
+ {{- end }}
94
+ {{- if (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) }}
95
+ - name : db-ssl-ca-crt
96
+ mountPath : /db-ssl-ca-crt
97
+ {{- end }}
98
+ {{- if .Values.zitadel.dbSslUserCrtSecret }}
99
+ - name : db-ssl-user-crt
100
+ mountPath : /db-ssl-user-crt
101
+ {{- end }}
102
+ securityContext :
103
+ runAsNonRoot : false
104
+ runAsUser : 0
105
+ {{- end }}
106
+ volumes :
107
+ - name : zitadel-config-yaml
108
+ configMap :
109
+ name : zitadel-config-yaml
110
+ {{- if .Values.zitadel.secretConfig }}
111
+ - name : zitadel-secrets-yaml
112
+ secret :
113
+ secretName : zitadel-secrets-yaml
114
+ {{- end }}
115
+ {{- if .Values.zitadel.configSecretName }}
116
+ - name : zitadel-secret-config-yaml
117
+ secret :
118
+ secretName : {{ .Values.zitadel.configSecretName }}
119
+ {{- end }}
120
+ {{- if .Values.zitadel.dbSslCaCrt }}
121
+ - name : db-ssl-ca-crt
122
+ secret :
123
+ secretName : db-ssl-ca-crt
124
+ {{- end }}
125
+ {{- if .Values.zitadel.dbSslCaCrtSecret }}
126
+ - name : db-ssl-ca-crt
127
+ secret :
128
+ secretName : {{ .Values.zitadel.dbSslCaCrtSecret }}
129
+ {{- end }}
130
+ {{- if .Values.zitadel.dbSslUserCrtSecret }}
131
+ - name : db-ssl-user-crt
132
+ secret :
133
+ secretName : {{ .Values.zitadel.dbSslUserCrtSecret }}
134
+ {{- end }}
135
+ - name : chowned-secrets
136
+ emptyDir : {}
137
+ {{- with .Values.nodeSelector }}
138
+ nodeSelector :
139
+ {{- toYaml . | nindent 8 }}
140
+ {{- end }}
141
+ {{- with .Values.affinity }}
142
+ affinity :
143
+ {{- toYaml . | nindent 8 }}
144
+ {{- end }}
145
+ {{- with .Values.tolerations }}
146
+ tolerations :
147
+ {{- toYaml . | nindent 8 }}
148
+ {{- end }}
149
+ {{- end }}
0 commit comments