Skip to content

Commit c7816c9

Browse files
committed
mariadb allow external secret
1 parent 5f277de commit c7816c9

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

templates/deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ spec:
7373
name: {{ .Release.Name }}-minio
7474
key: rootPassword
7575
{{- end }}
76+
{{- if (index .Values "mariadb-galera").external.secretRef.name }}
77+
- name: DATABASE_URL
78+
valueFrom:
79+
secretKeyRef:
80+
name: {{ (index .Values "mariadb-galera").external.secretRef.name }}
81+
key: {{ (index .Values "mariadb-galera").external.secretRef.databaseUrlKey }}
82+
{{- end }}
7683
ports:
7784
- name: http
7885
containerPort: {{ .Values.ctfd.service.port }}

templates/secret.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ metadata:
44
name: {{ include "ctfd.fullname" . }}
55
type: Opaque
66
data:
7+
{{- if not (index .Values "mariadb-galera").external.secretRef.name }}
78
DATABASE_URL: {{ include "ctfd.DATABASE_URL" . | b64enc }}
9+
{{- end }}
810
REDIS_URL: {{ include "ctfd.REDIS_URL" . | b64enc }}
911
SECRET_KEY: {{ randAlphaNum 64 | b64enc }}
1012
{{- if not .Values.minio.enabled }}

values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ mariadb-galera:
224224
external:
225225
port: 3306
226226
host: external-mariadb-host
227+
secretRef:
228+
name: null
229+
databaseUrlKey: DATABASE_URL
227230
username: ""
228231
password: ""
229232
database: ""

0 commit comments

Comments
 (0)