Skip to content

Commit

Permalink
Add extraEnvFromSecrets value to db chart
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Veschambre <gveschambre@petalmd.com>
  • Loading branch information
shepz authored and faridco committed Nov 14, 2024
1 parent 51c1bb7 commit a837bd8
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 31 deletions.
9 changes: 0 additions & 9 deletions aidbox/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,3 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/* Create the secret name for Aidbox, using existingSecret if set */}}
{{- define "aidbox.secretName" -}}
{{- if .Values.auth.existingSecret -}}
{{ .Values.auth.existingSecret }}
{{- else -}}
{{ include "aidbox.fullname" . }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion aidbox/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- configMapRef:
name: {{ include "aidbox.fullname" . }}
- secretRef:
name: {{ include "aidbox.secretName" . }}
name: {{ include "aidbox.fullname" . }}
{{- range .Values.extraEnvFromConfigMaps }}
- configMapRef:
name: {{ . }}
Expand Down
2 changes: 0 additions & 2 deletions aidbox/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if not .Values.auth.existingSecret -}}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -18,4 +17,3 @@ data:
{{ if .PGUSER }}PGUSER: {{ .PGUSER | b64enc }}{{ end }}
{{ if .PGPASSWORD }}PGPASSWORD: {{ .PGPASSWORD | b64enc }}{{ end }}
{{- end }}
{{- end -}}
3 changes: 0 additions & 3 deletions aidbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ config:
BOX_METRICS_PORT: 8765
PGPORT: 5432

auth:
existingSecret: ""

image:
repository: healthsamurai/aidboxone
pullPolicy: IfNotPresent
Expand Down
10 changes: 0 additions & 10 deletions aidboxdb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,3 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}


{{/* Create the secret name for AidboxDB, using existingSecret if set */}}
{{- define "aidboxdb.secretName" -}}
{{- if .Values.auth.existingSecret -}}
{{ .Values.auth.existingSecret }}
{{- else -}}
{{ include "aidboxdb.fullname" . }}
{{- end -}}
{{- end -}}
2 changes: 0 additions & 2 deletions aidboxdb/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if not .Values.auth.existingSecret -}}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -11,4 +10,3 @@ data:
POSTGRES_PASSWORD: {{ .POSTGRES_PASSWORD | b64enc }}
POSTGRES_USER: {{ .POSTGRES_USER | b64enc }}
{{- end }}
{{- end -}}
6 changes: 5 additions & 1 deletion aidboxdb/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ spec:
- configMapRef:
name: {{ $fullName }}-env
- secretRef:
name: {{ include "aidboxdb.secretName" . }}
name: {{ $fullName }}
{{- range .Values.extraEnvFromSecrets }}
- secretRef:
name: {{ . }}
{{- end }}
volumeMounts:
- name: db-pg-config
mountPath: /etc/configs
Expand Down
5 changes: 2 additions & 3 deletions aidboxdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres

auth:
existingSecret: ""

storage:
# -- Storage className to use
className: ""
Expand Down Expand Up @@ -50,6 +47,8 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

extraEnvFromSecrets: []

# -- Additional volumes
volumes: []
# - name: foo
Expand Down

0 comments on commit a837bd8

Please sign in to comment.