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

[bitnami/juypterhub] postgres image missing when postgres is disabled (fluxCD/argoCD) #28841

Merged
merged 11 commits into from
Aug 23, 2024

Conversation

leasley199
Copy link
Contributor

@leasley199 leasley199 commented Aug 12, 2024

Description of the change

When using fluxCD or argoCD and using an external postgres instances, the postgres image is lost in translation and causes the following error.

Helm install failed for release my_namespace/jupyterhub with chart [email protected]: template: jupyterhub/templates/hub/deployment.yaml:82:20: executing "jupyterhub/templates/hub/deployment.yaml" at <include "common.images.image" (dict "imageRoot" .Values.postgresql.image "global" .Values.global)>: error calling include: template: jupyterhub/charts/common/templates/_images.tpl:12:39: executing "common.images.image" at <.imageRoot.registry>: can't evaluate field registry in type interface {}

This creates a catchall so that the deploy user/manifest can still lint the postgres image to the init container and deploy successfully.

Benefits

fluxCD and ArgoCD deployments are happy. For some odd reason this is not happening in non CD deployments. Believe it to be due to helm rendering validation baked into flux and argo.

Possible drawbacks

none to my knowledge, if postgres.image is not set, uses defaults from helm chart.

Applicable issues

None

Additional information

Simply just allows the deployer to specify the postgres image for the init-container, currently fails and prevents deployments in CD tools.

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

Signed-off-by: Lucas Easley <[email protected]>
Signed-off-by: Lucas Easley <[email protected]>
fix formatting for postgres.image

Signed-off-by: Lucas Easley <[email protected]>
fix postgres juypterhub issue
leasley199 and others added 2 commits August 12, 2024 15:35
Signed-off-by: Bitnami Containers <[email protected]>
@javsalgar javsalgar added verify Execute verification workflow for these changes in-progress labels Aug 13, 2024
@github-actions github-actions bot removed the triage Triage is needed label Aug 13, 2024
@github-actions github-actions bot removed the request for review from javsalgar August 13, 2024 08:43
@github-actions github-actions bot requested a review from fmulero August 13, 2024 08:43
Signed-off-by: Bitnami Containers <[email protected]>
Copy link
Collaborator

@fmulero fmulero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!!! thanks a lot @leasley199 to work on this fix.

This is happening because the postgresql subchart is using the postgresql.enabled value as condition:

- condition: postgresql.enabled
name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 15.x.x

Please take a glance to the solution adopted in concourse to follow the same pattern:

{{- if .Values.postgresql.enabled }}
# NOTE: The value postgresql.image is not available unless postgresql.enabled is not set. We could change this to use os-shell if
# it had the binary wait-for-port.
# This init container is for avoiding CrashLoopback errors in the Hub container because the PostgreSQL container is not ready
- name: wait-for-db
image: {{ include "common.images.image" (dict "imageRoot" .Values.postgresql.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}

I think is worth to follow the same solution.

@leasley199
Copy link
Contributor Author

Nice catch!!! thanks a lot @leasley199 to work on this fix.

This is happening because the postgresql subchart is using the postgresql.enabled value as condition:

- condition: postgresql.enabled
name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 15.x.x

Please take a glance to the solution adopted in concourse to follow the same pattern:

{{- if .Values.postgresql.enabled }}
# NOTE: The value postgresql.image is not available unless postgresql.enabled is not set. We could change this to use os-shell if
# it had the binary wait-for-port.
# This init container is for avoiding CrashLoopback errors in the Hub container because the PostgreSQL container is not ready
- name: wait-for-db
image: {{ include "common.images.image" (dict "imageRoot" .Values.postgresql.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}

I think is worth to follow the same solution.

much better approach updated my branch with the suggested changes :) many thank!

Signed-off-by: Bitnami Containers <[email protected]>
Copy link
Collaborator

@fmulero fmulero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @leasley199

LGTM

@fmulero fmulero merged commit 079ff70 into bitnami:main Aug 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jupyterhub solved verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants