Skip to content

Commit

Permalink
Add a databaseSecrets value to populate the DATABASE variables (#186)
Browse files Browse the repository at this point in the history
* Add databaseSecrets

* Fix unwanted .unleash.

* fix databasesecrets default as an array

* update chart version to 5.4.1

* fixed spelling mistate in values file

* Remove trailing whitespace

---------

Co-authored-by: sshort <steve.short@fortra.com>
  • Loading branch information
sshort and sshort authored Feb 21, 2025
1 parent 6b5cf97 commit f9e9a4f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/unleash/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: https://docs.getunleash.io/img/logo.svg

type: application

version: 5.4.0
version: 5.4.1

appVersion: "6.6.0"

Expand Down
10 changes: 10 additions & 0 deletions charts/unleash/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ spec:
{{- end }}
- name: DATABASE_NAME
value: "{{ .Values.dbConfig.database }}"
{{ if .Values.databaseSecrets}}
{{- range .Values.databaseSecrets }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
name: {{ .valueFrom.secretKeyRef.name }}
key: {{ .valueFrom.secretKeyRef.key }}
{{- end }}
{{- else }}
- name: DATABASE_HOST
value: "{{ if .Values.postgresql.enabled }}{{ .Values.postgresql.fullnameOverride }}{{ else }}{{ .Values.dbConfig.host }}{{ end }}"
- name: DATABASE_PASSWORD
Expand All @@ -55,6 +64,7 @@ spec:
value: "{{ .Values.dbConfig.port }}"
- name: DATABASE_USERNAME
value: "{{ .Values.dbConfig.user }}"
{{- end }}
{{- if .Values.dbConfig.ssl }}
- name: DATABASE_SSL
value: {{ .Values.dbConfig.ssl | toJson | quote }}
Expand Down
24 changes: 24 additions & 0 deletions charts/unleash/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,30 @@ dbConfig:
# sslRejectUnauthorized can be set to true|false. Don't set this to false in production, it will void any security you get from using SSL to connect
# sslRejectUnauthorized

# adds DATABASE_ host, port, username and password environment vars from a secrets file for use with Crossplane RDSInstance
databaseSecrets:
[]
# - name: DATABASE_HOST
# valueFrom:
# secretKeyRef:
# name: db-conn
# key: endpoint
# - name: DATABASE_PORT
# valueFrom:
# secretKeyRef:
# name: db-conn
# key: port
# - name: DATABASE_USERNAME
# valueFrom:
# secretKeyRef:
# name: db-conn
# key: username
# - name: DATABASE_PASSWORD
# valueFrom:
# secretKeyRef:
# name: db-conn
# key: password

env: []
# - name: GOOGLE_CLIENT_ID
# value: 999999999999-999z99zz9zzzzzz99z9zz9z9zzzzzz9z.apps.googleusercontent.com
Expand Down

0 comments on commit f9e9a4f

Please sign in to comment.