Skip to content

Commit

Permalink
Merge pull request pmint93#140 from dumitraand/feat/allow-multiple-db…
Browse files Browse the repository at this point in the history
…-params-from-existing-secrets

[charts/metabase] (feat) Allow more DB Params from existing secrets
  • Loading branch information
pmint93 authored Aug 22, 2024
2 parents 6736a9b + 1312612 commit 1cd289b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/metabase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description:
The easy, open source way for everyone in your company to ask questions
and learn from data.
name: metabase
version: 2.16.6
version: 2.16.7
appVersion: v0.50.6
maintainers:
- name: pmint93
Expand Down
24 changes: 24 additions & 0 deletions charts/metabase/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,37 @@ spec:
name: {{ (printf "%s-database" (include "metabase.fullname" .)) }}
key: connectionURI
{{- else }}
{{- if and .Values.database.existingSecret .Values.database.existingSecretHostKey }}
- name: MB_DB_HOST
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret }}
key: {{ .Values.database.existingSecretHostKey }}
{{- else }}
- name: MB_DB_HOST
value: {{ .Values.database.host | quote }}
{{- end }}
{{- if and .Values.database.existingSecret .Values.database.existingSecretPortKey }}
- name: MB_DB_PORT
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret }}
key: {{ .Values.database.existingSecretPortKey }}
{{- else }}
- name: MB_DB_PORT
value: {{ .Values.database.port | quote }}
{{- end}}
{{- if and .Values.database.existingSecret .Values.database.existingSecretDatabaseNameKey }}
- name: MB_DB_DBNAME
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret }}
key: {{ .Values.database.existingSecretDatabaseNameKey }}
{{- else }}
- name: MB_DB_DBNAME
value: {{ .Values.database.dbname | quote }}
{{- end }}
{{- end }}
{{- if and .Values.database.existingSecret .Values.database.existingSecretUsernameKey }}
- name: MB_DB_USER
valueFrom:
Expand Down
3 changes: 3 additions & 0 deletions charts/metabase/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ database:
# existingSecretPasswordKey:
# existingSecretConnectionURIKey:
# existingSecretEncryptionKeyKey:
# existingSecretPortKey:
# existingSecretHostKey:
# existingSecretDatabaseNameKey:
## One or more Google Cloud SQL database instances can be made available to Metabase via the *Cloud SQL Auth proxy*.
## These can be used for Metabase's internal database (by specifying `host: localhost` and the port above), or as
## additional databases (configured at Admin → Databases). Workload Identity should be used for authentication, so
Expand Down

0 comments on commit 1cd289b

Please sign in to comment.