Skip to content

Commit

Permalink
fix(helm): registry missing in postgresql templating (#26569)
Browse files Browse the repository at this point in the history
## Summary & Motivation
The postgresql chart uses the "registry" value to prefix the image name.
This value was not already set in the values.yaml so I had to dig into
the chart.

Additionally, the Dagster helm templates don't use this registry value
to create the image name. So if you do provide a custom registry:
"myprivate.acr.io", then it will be correctly used in the postgresql
helm, but not in the dagster initdbcontainerReady creation, since there
the registry is missing, and it will fail to pull the image.

---------

Co-authored-by: Mathieu Larose <[email protected]>
  • Loading branch information
ion-elgreco and mlarose authored Dec 18, 2024
1 parent e266da3 commit ff569ad
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
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 @@ -42,7 +42,7 @@ spec:
initContainers:
{{- if $celeryK8sRunLauncherConfig.checkDbReadyInitContainer }}
- name: check-db-ready
image: "{{- $.Values.postgresql.image.repository -}}:{{- $.Values.postgresql.image.tag -}}"
image: {{ include "dagster.externalPostgresImage.name" $.Values.postgresql.image | quote }}
imagePullPolicy: "{{- $.Values.postgresql.image.pullPolicy -}}"
command: ['sh', '-c', {{ include "dagster.postgresql.pgisready" $ | squote }}]
securityContext:
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 @@ -51,7 +51,7 @@ spec:
initContainers:
{{- if .Values.dagsterDaemon.checkDbReadyInitContainer }}
- name: check-db-ready
image: {{ include "dagster.externalImage.name" $.Values.postgresql.image | quote }}
image: {{ include "dagster.externalPostgresImage.name" $.Values.postgresql.image | quote }}
imagePullPolicy: "{{- $.Values.postgresql.image.pullPolicy -}}"
command: ['sh', '-c', {{ include "dagster.postgresql.pgisready" . | squote }}]
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/templates/deployment-flower.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
initContainers:
{{- if .Values.flower.checkDbReadyInitContainer }}
- name: check-db-ready
image: "{{- $.Values.postgresql.image.repository -}}:{{- $.Values.postgresql.image.tag -}}"
image: {{ include "dagster.externalPostgresImage.name" $.Values.postgresql.image | quote }}
imagePullPolicy: "{{- $.Values.postgresql.image.pullPolicy -}}"
command: ['sh', '-c', {{ include "dagster.postgresql.pgisready" . | squote }}]
securityContext:
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 @@ -49,7 +49,7 @@ spec:
initContainers:
{{- if .Values.dagsterWebserver.checkDbReadyInitContainer }}
- name: check-db-ready
image: {{ include "dagster.externalImage.name" .Values.postgresql.image | quote }}
image: {{ include "dagster.externalPostgresImage.name" .Values.postgresql.image | quote }}
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}
command: ['sh', '-c', {{ include "dagster.postgresql.pgisready" . | squote }}]
securityContext:
Expand Down
4 changes: 4 additions & 0 deletions helm/dagster/templates/helpers/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ If release name contains chart name it will be used as a full name.
{{- .repository -}}:{{- .tag -}}
{{- end }}

{{- define "dagster.externalPostgresImage.name" }}
{{- .registry -}}/{{- .repository -}}:{{- .tag -}}
{{- end }}

{{- define "dagster.dagsterImage.name" }}
{{- $ := index . 0 }}

Expand Down
1 change: 1 addition & 0 deletions helm/dagster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ postgresql:

# Used by init container to check that db is running. (Even if enabled:false)
image:
registry: "docker.io"
repository: "library/postgres"
tag: "14.6"
pullPolicy: IfNotPresent
Expand Down

0 comments on commit ff569ad

Please sign in to comment.