-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b72260
commit 0bf1764
Showing
5 changed files
with
189 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
{{- if .Values.zitadel.debug.enabled }} | ||
apiVersion: apps/v1 | ||
kind: ReplicaSet | ||
metadata: | ||
name: "{{ include "zitadel.fullname" . }}-debug" | ||
labels: | ||
app.kubernetes.io/component: debug | ||
{{- with .Values.zitadel.debug.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "zitadel.debugSelectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
checksum/secret-db-ssl-root-crt: {{ include (print $.Template.BasePath "/secret_db-ssl-root-crt.yaml") . | sha256sum }} | ||
checksum/secret-zitadel-secrets: {{ include (print $.Template.BasePath "/secret_zitadel-secrets.yaml") . | sha256sum }} | ||
labels: | ||
{{- include "zitadel.debugSelectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "zitadel.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
enableServiceLinks: false | ||
containers: | ||
- name: "{{ .Chart.Name }}-debug" | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 14 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}-debug" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
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' ] | ||
env: | ||
- name: ZITADEL_MASTERKEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ default "zitadel-masterkey" .Values.zitadel.masterkeySecretName }} | ||
key: masterkey | ||
- name: ZITADEL_FIRSTINSTANCE_MACHINEKEYPATH | ||
value: "/machinekey/sa.json" | ||
{{- $dbEnv := get (include "zitadel.dbkey.json" . | fromJson) "env" }} | ||
{{- if (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) }} | ||
- name: ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_ROOTCERT | ||
value: /.secrets/db-ssl-ca-crt/ca.crt | ||
{{- end }} | ||
{{- if .Values.zitadel.dbSslUserCrtSecret }} | ||
- name: ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_CERT | ||
value: /.secrets/db-ssl-user-crt/tls.crt | ||
- name: ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_KEY | ||
value: /.secrets/db-ssl-user-crt/tls.key | ||
{{- end}} | ||
{{- with .Values.env }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: zitadel-config-yaml | ||
mountPath: /config | ||
- name: chowned-secrets | ||
mountPath: /.secrets | ||
{{- if or .Values.zitadel.secretConfig .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret .Values.zitadel.dbSslUserCrtSecret .Values.zitadel.configSecretName }} | ||
initContainers: | ||
- args: | ||
- "{{ include "zitadel.joincpcommands" (dict "commands" (list | ||
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.secretConfig "path" "/zitadel-secrets-yaml/" )) | ||
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.configSecretName "path" "/zitadel-secret-config-yaml/" )) | ||
(include "zitadel.makecpcommand" (dict "value" (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) "path" "/db-ssl-ca-crt/" )) | ||
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.dbSslUserCrtSecret "path" "/db-ssl-user-crt/" )) | ||
)) }} chown -R 1000:1000 /chowned-secrets/ && find /chowned-secrets/ -type f -exec chmod 400 -- {} + " | ||
command: | ||
- sh | ||
- -c | ||
image: "{{ .Values.chownImage.repository }}:{{ .Values.chownImage.tag }}" | ||
imagePullPolicy: {{ .Values.chownImage.pullPolicy }} | ||
name: chown | ||
volumeMounts: | ||
- name: chowned-secrets | ||
mountPath: /chowned-secrets | ||
{{- if .Values.zitadel.secretConfig }} | ||
- name: zitadel-secrets-yaml | ||
mountPath: /zitadel-secrets-yaml | ||
{{- end }} | ||
{{- if .Values.zitadel.configSecretName }} | ||
- name: zitadel-secret-config-yaml | ||
mountPath: /zitadel-secret-config-yaml | ||
{{- end }} | ||
{{- if (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) }} | ||
- name: db-ssl-ca-crt | ||
mountPath: /db-ssl-ca-crt | ||
{{- end }} | ||
{{- if .Values.zitadel.dbSslUserCrtSecret }} | ||
- name: db-ssl-user-crt | ||
mountPath: /db-ssl-user-crt | ||
{{- end }} | ||
securityContext: | ||
runAsNonRoot: false | ||
runAsUser: 0 | ||
{{- end }} | ||
volumes: | ||
- name: zitadel-config-yaml | ||
configMap: | ||
name: zitadel-config-yaml | ||
{{- if .Values.zitadel.secretConfig }} | ||
- name: zitadel-secrets-yaml | ||
secret: | ||
secretName: zitadel-secrets-yaml | ||
{{- end }} | ||
{{- if .Values.zitadel.configSecretName }} | ||
- name: zitadel-secret-config-yaml | ||
secret: | ||
secretName: {{ .Values.zitadel.configSecretName }} | ||
{{- end }} | ||
{{- if .Values.zitadel.dbSslCaCrt }} | ||
- name: db-ssl-ca-crt | ||
secret: | ||
secretName: db-ssl-ca-crt | ||
{{- end }} | ||
{{- if .Values.zitadel.dbSslCaCrtSecret }} | ||
- name: db-ssl-ca-crt | ||
secret: | ||
secretName: {{ .Values.zitadel.dbSslCaCrtSecret }} | ||
{{- end }} | ||
{{- if .Values.zitadel.dbSslUserCrtSecret }} | ||
- name: db-ssl-user-crt | ||
secret: | ||
secretName: {{ .Values.zitadel.dbSslUserCrtSecret }} | ||
{{- end }} | ||
- name: chowned-secrets | ||
emptyDir: {} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters