Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add databaseSecrets to read DATABASE_ vars from secret file #185

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 enviroment 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
Loading