Skip to content

Commit

Permalink
Merge pull request #11 from zitadel/insecure-crdb
Browse files Browse the repository at this point in the history
enable insecure cockroachdb
  • Loading branch information
eliobischof authored Jun 15, 2022
2 parents d9d9ca6 + 17dc456 commit 90e331c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/zitadel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: zitadel
description: A Helm chart for ZITADEL v2
type: application
version: 2.0.1
version: 2.1.0
appVersion: "v2.0.0-v2-alpha.23-amd64"
kubeVersion: '>= 1.16.15 < 1.25.0'
icon: https://zitadel.zitadel.cloud/ui/login/resources/themes/zitadel/logo-dark.svg
Expand Down
24 changes: 12 additions & 12 deletions charts/zitadel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
- name: ZITADEL_ADMINUSER_SSL_ROOTCERT
value: /.secrets/ca.crt
{{- end}}
{{- if .Values.cockroachdb.enabled }}
{{- if .Values.zitadel.dbSslClientCrtSecret }}
- name: ZITADEL_ADMINUSER_SSL_CERT
value: /.secrets/tls.crt
- name: ZITADEL_ADMINUSER_SSL_KEY
Expand All @@ -77,9 +77,9 @@ spec:
- args:
- "{{ include "zitadel.joincpcommands" (dict "commands" (list
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.secretConfig "path" "/zitadel-secrets-yaml/*" ))
(include "zitadel.makecpcommand" (dict "value" (or .Values.zitadel.dbSslRootCrt .Values.zitadel.dbSslRootCrtSecret) "path" "/db-ssl-root-crt/*" ))
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.masterkey "path" "/zitadel-masterkey/*" ))
(include "zitadel.makecpcommand" (dict "value" .Values.cockroachdb.enabled "path" "/root-certs/*" ))
(include "zitadel.makecpcommand" (dict "value" (or .Values.zitadel.dbSslRootCrt .Values.zitadel.dbSslRootCrtSecret) "path" "/db-ssl-root-crt/*" ))
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.dbSslClientCrtSecret "path" "/db-ssl-client-crt/*" ))
)) }} chown -R 1000:1000 /chowned-secrets/* && chmod 400 /chowned-secrets/*"
command:
- sh
Expand All @@ -100,9 +100,9 @@ spec:
- name: db-ssl-root-crt
mountPath: /db-ssl-root-crt
{{- end}}
{{- if .Values.cockroachdb.enabled }}
- name: root-certs
mountPath: /root-certs
{{- if (and .Values.cockroachdb.enabled .Values.cockroachdb.tls.enabled) }}
- name: db-ssl-client-crt
mountPath: /db-ssl-client-crt
{{- end}}
securityContext:
runAsNonRoot: false
Expand All @@ -111,25 +111,25 @@ spec:
- name: zitadel-config-yaml
configMap:
name: zitadel-config-yaml
{{- if .Values.zitadel.secretConfig }}
{{- if (not ( empty .Values.zitadel.secretConfig)) }}
- name: zitadel-secrets-yaml
secret:
secretName: zitadel-secrets-yaml
{{- end }}
{{- if .Values.zitadel.dbSslRootCrt }}
{{- if (not ( empty .Values.zitadel.dbSslRootCrt)) }}
- name: db-ssl-root-crt
secret:
secretName: db-ssl-root-crt
{{- end }}
{{- if .Values.zitadel.dbSslRootCrtSecret }}
{{- if (not ( empty .Values.zitadel.dbSslRootCrtSecret )) }}
- name: db-ssl-root-crt
secret:
secretName: {{.Values.zitadel.dbSslRootCrtSecret}}
{{- end }}
{{- if .Values.cockroachdb.enabled }}
- name: root-certs
{{- if (not ( empty .Values.zitadel.dbSslClientCrtSecret )) }}
- name: db-ssl-client-crt
secret:
secretName: crdb-client-secret
secretName: {{.Values.zitadel.dbSslClientCrtSecret}}
{{- end }}
- name: zitadel-masterkey
secret:
Expand Down
4 changes: 2 additions & 2 deletions charts/zitadel/templates/secret_zitadel-secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if (and .Values.cockroachdb.enabled .Values.cockroachdb.tls.enabled (not .Values.zitadel.secretConfig.Database.User.Password ))}}
{{- fail ".Values.zitadel.secretConfig.Database.User.Password is mandatory for tls enabled cockroach"}}
{{- if (and .Values.cockroachdb.enabled .Values.cockroachdb.tls.enabled (not (((.Values.zitadel.secretConfig).Database).User).Password)) }}
{{- fail ".Values.zitadel.secretConfig.Database.User.Password is mandatory for tls enabled cockroach" }}
{{- end }}
apiVersion: v1
kind: Secret
Expand Down
6 changes: 3 additions & 3 deletions charts/zitadel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ zitadel:
# See all defaults here:
# https://github.com/zitadel/zitadel/blob/v2-alpha/cmd/defaults.yaml
secretConfig:
Database:
User:
Password: ""

# ZITADEL uses the masterkey for symmetric encryption.
# You can generate it for example with tr -dc A-Za-z0-9 </dev/urandom | head -c 32
Expand All @@ -44,6 +41,9 @@ zitadel:
# The Secret containing the root CA Certificate at key ca.crt needed for establishing secure database connections
dbSslRootCrtSecret: 'crdb-ca-secret'

# The Secret containing the client CA Certificate and key at tls.crt and tls.key needed for establishing secure database connections
dbSslClientCrtSecret: 'crdb-client-secret'

replicaCount: 3

image:
Expand Down

0 comments on commit 90e331c

Please sign in to comment.