-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use external secret for postgres (#33)
Co-authored-by: owlas <[email protected]>
- Loading branch information
Showing
8 changed files
with
64 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{{- if not .Values.postgresql.enabled }} | ||
{{- if not .Values.postgresql.enabled -}} | ||
{{- if not .Values.externalDatabase.existingSecret -}} | ||
# The user is using an external database and has not provided a secret with the credentials. | ||
# This creates a secret with the password provided in the values.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "lightdash.postgresql.secretName" . }} | ||
name: {{ include "lightdash.database.secretName" . }} | ||
annotations: | ||
helm.sh/hook: pre-install,pre-upgrade | ||
helm.sh/hook-weight: "-1" | ||
data: | ||
postgresql-password: {{ .Values.externalDatabase.password | b64enc }} | ||
{{ include "lightdash.database.secret.passwordKey" . }}: {{ (include "lightdash.database.password") | b64enc}} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
{{- if .Values.secrets }} | ||
{{- if .Values.secrets -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "lightdash.fullname" . }} | ||
labels: | ||
{{- include "lightdash.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: | ||
PGPASSWORD: {{ .Values.postgresql.auth.password }} | ||
data: | ||
{{- range $key, $value := .Values.secrets }} | ||
{{ $key }}: {{ default "MISSING" $value | b64enc | quote }} | ||
{{- end }} | ||
{{- end}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters