diff --git a/charts/vaultwarden/Chart.yaml b/charts/vaultwarden/Chart.yaml index e17e083..985fe8c 100644 --- a/charts/vaultwarden/Chart.yaml +++ b/charts/vaultwarden/Chart.yaml @@ -13,5 +13,5 @@ maintainers: - name: guerzon email: guerzon@proton.me url: https://github.com/guerzon -version: 0.23.1 +version: 0.24.0 kubeVersion: ">=1.12.0-0" diff --git a/charts/vaultwarden/templates/_podSpec.tpl b/charts/vaultwarden/templates/_podSpec.tpl index 51f15a0..5cd8eab 100644 --- a/charts/vaultwarden/templates/_podSpec.tpl +++ b/charts/vaultwarden/templates/_podSpec.tpl @@ -68,7 +68,24 @@ containers: - name: DISABLE_ADMIN_TOKEN value: "true" {{- end }} - {{- if ne "default" .Values.database.type }} + {{- if and ( eq .Values.database.type "postgresql") (not .Values.database.existingSecretKey)}} + - name: PGHOST + value: {{ .Values.database.host }} + - name: PGPORT + value: {{ .Values.database.port }} + - name: PGDATABASE + value: {{ .Values.database.dbName }} + - name: PGUSER + valueFrom: + secretKeyRef: + name: {{ .Values.database.existingSecret }} + key: {{ .Values.database.existingSecretUserKey }} + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.database.existingSecret }} + key: {{ .Values.database.existingSecretPasswordKey }} + {{- else if ne "default" .Values.database.type }} - name: DATABASE_URL {{- if .Values.database.existingSecret }} valueFrom: diff --git a/charts/vaultwarden/values.yaml b/charts/vaultwarden/values.yaml index 9cc5853..15ea40f 100644 --- a/charts/vaultwarden/values.yaml +++ b/charts/vaultwarden/values.yaml @@ -282,7 +282,11 @@ database: existingSecret: "" ## @param database.existingSecretKey Key in the existing secret ## - existingSecretKey: "" + existingSecretKey: null + existingSecretUserKey: username + existingSecretPasswordKey: password + # existingSecretKey: uri + ## @param database.connectionRetries Number of times to retry the database connection during startup, with 1 second delay between each retry, set to 0 to retry indefinitely. ## connectionRetries: 15