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

Support configuration of Postgresql secret password key #26717

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "dagsterUserDeployments.postgresql.secretName" $ }}
key: postgresql-password
key: {{ include "dagsterUserDeployments.postgresql.secretPasswordKey" $ }}
{{- $includeConfigInLaunchedRuns := $deployment.includeConfigInLaunchedRuns | default (dict "enabled" true) }}
{{- if $includeConfigInLaunchedRuns.enabled }}
{{- if $deployment.dagsterApiGrpcArgs }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Create the name of the service account to use
{{- $global.postgresqlSecretName | default .Values.postgresqlSecretName }}
{{- end -}}

{{- define "dagsterUserDeployments.postgresql.secretPasswordKey" -}}
{{- $global := .Values.global | default dict }}
{{- $global.postgresqlSecretPasswordKey | default .Values.postgresqlSecretPasswordKey }}
{{- end -}}

{{/*
This environment shared across all User Code containers
*/}}
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/templates/deployment-celery-queues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "dagster.postgresql.secretName" $ | quote }}
key: postgresql-password
key: {{ include "dagster.postgresql.secretPasswordKey" $ | quote }}
envFrom:
- configMapRef:
name: {{ template "dagster.fullname" $ }}-celery-worker-env
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/templates/deployment-daemon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "dagster.postgresql.secretName" $ | quote }}
key: postgresql-password
key: {{ include "dagster.postgresql.secretPasswordKey" $ | quote }}
- name: DAGSTER_DAEMON_HEARTBEAT_TOLERANCE
value: "{{ .Values.dagsterDaemon.heartbeatTolerance }}"
# This is a list by default, but for backcompat it can be a map. As a map it's written to the daemon-env
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/templates/helpers/_deployment-webserver.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "dagster.postgresql.secretName" . | quote }}
key: postgresql-password
key: {{ include "dagster.postgresql.secretPasswordKey" $ | quote }}
# This is a list by default, but for backcompat it can be a map. As
# a map it's written to the webserver-env configmap.
{{- if and ($_.Values.dagsterWebserver.env) (kindIs "slice" $_.Values.dagsterWebserver.env) }}
Expand Down
8 changes: 8 additions & 0 deletions helm/dagster/templates/helpers/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ See: https://github.com/helm/charts/blob/61c2cc0db49b06b948f90c8e44e9143d7bab430
{{- end }}
{{- end }}

{{- define "dagster.postgresql.secretPasswordKey" -}}
{{- if .Values.global.postgresqlSecretPasswordKey }}
{{- .Values.global.postgresqlSecretPasswordKey }}
{{- else }}
{{- printf "postgresql-password" }}
{{- end }}
{{- end }}

{{/*
Celery options
*/}}
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/templates/job-instance-migrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "dagster.postgresql.secretName" . | quote }}
key: postgresql-password
key: {{ include "dagster.postgresql.secretPasswordKey" $ | quote }}
envFrom:
- configMapRef:
name: {{ template "dagster.fullname" . }}-webserver-env
Expand Down
4 changes: 4 additions & 0 deletions helm/dagster/values.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions helm/dagster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
---
global:
postgresqlSecretName: "dagster-postgresql-secret"
postgresqlSecretPasswordKey: "postgresql-password"
# The DAGSTER_HOME env var is set by default on all nodes from this value
dagsterHome: "/opt/dagster/dagster_home"

Expand Down