Skip to content

Commit a837bd8

Browse files
shepzfaridco
authored andcommitted
Add extraEnvFromSecrets value to db chart
Signed-off-by: Guillaume Veschambre <[email protected]>
1 parent 51c1bb7 commit a837bd8

File tree

8 files changed

+8
-31
lines changed

8 files changed

+8
-31
lines changed

aidbox/templates/_helpers.tpl

-9
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,3 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63-
64-
{{/* Create the secret name for Aidbox, using existingSecret if set */}}
65-
{{- define "aidbox.secretName" -}}
66-
{{- if .Values.auth.existingSecret -}}
67-
{{ .Values.auth.existingSecret }}
68-
{{- else -}}
69-
{{ include "aidbox.fullname" . }}
70-
{{- end -}}
71-
{{- end -}}

aidbox/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
- configMapRef:
3333
name: {{ include "aidbox.fullname" . }}
3434
- secretRef:
35-
name: {{ include "aidbox.secretName" . }}
35+
name: {{ include "aidbox.fullname" . }}
3636
{{- range .Values.extraEnvFromConfigMaps }}
3737
- configMapRef:
3838
name: {{ . }}

aidbox/templates/secrets.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- if not .Values.auth.existingSecret -}}
21
apiVersion: v1
32
kind: Secret
43
metadata:
@@ -18,4 +17,3 @@ data:
1817
{{ if .PGUSER }}PGUSER: {{ .PGUSER | b64enc }}{{ end }}
1918
{{ if .PGPASSWORD }}PGPASSWORD: {{ .PGPASSWORD | b64enc }}{{ end }}
2019
{{- end }}
21-
{{- end -}}

aidbox/values.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ config:
1010
BOX_METRICS_PORT: 8765
1111
PGPORT: 5432
1212

13-
auth:
14-
existingSecret: ""
15-
1613
image:
1714
repository: healthsamurai/aidboxone
1815
pullPolicy: IfNotPresent

aidboxdb/templates/_helpers.tpl

-10
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,3 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63-
64-
65-
{{/* Create the secret name for AidboxDB, using existingSecret if set */}}
66-
{{- define "aidboxdb.secretName" -}}
67-
{{- if .Values.auth.existingSecret -}}
68-
{{ .Values.auth.existingSecret }}
69-
{{- else -}}
70-
{{ include "aidboxdb.fullname" . }}
71-
{{- end -}}
72-
{{- end -}}

aidboxdb/templates/secrets.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- if not .Values.auth.existingSecret -}}
21
apiVersion: v1
32
kind: Secret
43
metadata:
@@ -11,4 +10,3 @@ data:
1110
POSTGRES_PASSWORD: {{ .POSTGRES_PASSWORD | b64enc }}
1211
POSTGRES_USER: {{ .POSTGRES_USER | b64enc }}
1312
{{- end }}
14-
{{- end -}}

aidboxdb/templates/statefulset.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ spec:
4646
- configMapRef:
4747
name: {{ $fullName }}-env
4848
- secretRef:
49-
name: {{ include "aidboxdb.secretName" . }}
49+
name: {{ $fullName }}
50+
{{- range .Values.extraEnvFromSecrets }}
51+
- secretRef:
52+
name: {{ . }}
53+
{{- end }}
5054
volumeMounts:
5155
- name: db-pg-config
5256
mountPath: /etc/configs

aidboxdb/values.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ env:
1010
POSTGRES_USER: postgres
1111
POSTGRES_DB: postgres
1212

13-
auth:
14-
existingSecret: ""
15-
1613
storage:
1714
# -- Storage className to use
1815
className: ""
@@ -50,6 +47,8 @@ securityContext: {}
5047
# runAsNonRoot: true
5148
# runAsUser: 1000
5249

50+
extraEnvFromSecrets: []
51+
5352
# -- Additional volumes
5453
volumes: []
5554
# - name: foo

0 commit comments

Comments
 (0)