Skip to content

Commit 1efbb2a

Browse files
authored
Merge pull request #178 from kmala/charts
feat(charts): Add support to specify creds for in cluster db through values file
2 parents 1ef7a37 + 830cee8 commit 1efbb2a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

charts/database/templates/database-secret-creds.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ metadata:
88
annotations:
99
"helm.sh/hook": pre-install
1010
data: {{ if eq .Values.global.database_location "on-cluster"}}
11-
user: {{ randAlphaNum 32 | b64enc }}
12-
password: {{ randAlphaNum 32 | b64enc }}{{ else if eq .Values.global.database_location "off-cluster"}}
11+
user: {{ if .Values.username | default "" | ne "" }}{{ .Values.username | b64enc }}{{ else }}{{ randAlphaNum 32 | b64enc }}{{ end }}
12+
password: {{ if .Values.password | default "" | ne "" }}{{ .Values.password | b64enc }}{{ else }}{{ randAlphaNum 32 | b64enc }}{{ end }}{{ else if eq .Values.global.database_location "off-cluster"}}
1313
user: {{ .Values.postgres.username | b64enc }}
1414
password: {{ .Values.postgres.password | b64enc }}
1515
name: {{ .Values.postgres.name | b64enc }}

charts/database/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ pull_policy: "Always"
33
docker_tag: canary
44
# limits_cpu: "100m"
55
# limits_memory: "50Mi"
6+
# The username and password to be used by the on-cluster database.
7+
# If left empty they will be generated using randAlphaNum
8+
username: ""
9+
password: ""
610

711
postgres:
812
name: "database name"

0 commit comments

Comments
 (0)