jupyterhub / zero-to-jupyterhub-k8s

Helm Chart & Documentation for deploying JupyterHub on Kubernetes
https://zero-to-jupyterhub.readthedocs.io
Other
1.54k stars 796 forks source link

config.yaml setting no longer works - possibly due to passthrough update? #1023

Closed samuelmanzer closed 4 years ago

samuelmanzer commented 5 years ago

Using this pullPolicy setting used to work to get pods to always pull the latest image version:

singleuser:
   image:
     name: [my image]
     tag: latest
     pullPolicy: Always

However, it is now ignored, based on inspection of the spawned pods. Back when I submitted this issue the pullPolicy value was passed through like this:

singleuser.image-pull-policy: {{ .Values.singleuser.image.pullPolicy | quote }}

But I think this PR may have changed how things are passed through. This is what now seems to work:

singleuser:
  imagePullPolicy: Always

Will do a PR for the docs when I have time - there may be other settings with this issue.

consideRatio commented 5 years ago

It seems all our image specifications, except the hub's, are made with:

image:
  name: myname
  tag: mytag
  pullPolicy: mypullpolicy

PRs making sense to me

Actions for PR 1 - Solved by @vmarkovtsev in #1248!

Fix jupyterhub_config.py so that it properly sets the c.KubeSpawner.image_pull_policy to the value provided in in values.yaml as singleuser.image.pullPolicy.

Actions for PR 2

Make the hub's image pull policy be configurable in the same manner while remaining backward compatible and providing a deprecation warning in NOTES.txt if hub.imagePullPolicy is utilized.

manycoding commented 5 years ago

@consideRatio I tried several ways and nothing worked for me so far.

I have an image tag latest which I update periodically. To avoid unnecessary jhub deploys I set

singleuser:
  image:
    name: images.s.com/jupyterhub-app/arche-notebook
    tag: latest
    pullPolicy: "Always"

But continuous-image-puller hasn't pulled anything new after the first updated when I set latest.

I also tried:

singleuser:
  image:
    name: images.s.com/jupyterhub-app/arche-notebook
    tag: latest
  imagePullPolicy: Always

Update continuous-image-puller is not affected by these settings at all

consideRatio commented 5 years ago

@manycoding the imagePullPolicy on a pod will be considered only when the pod is starting up, so if it is already running it wont matter if there has arrived a new version of the image. If you add a new node to the cluster, a new continuous-image-puller pod will be added and hence a new pulling process start.

To influence both the hook (pre-upgrade) and continuous image-pullers, you should use the singleuser.image.pullPolicy value, at least as of latest chart release.

If we focus on the user pods which is what is really essential, you could try verify what policy they have been set with kubectl get pod -o yaml jupyter-myuser | grep imagePullPolicy

consideRatio commented 5 years ago

https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/8ed2f8111b5575dc5df29afb114a8ee5906f9a96/images/hub/jupyterhub_config.py#L103

Oh okay, hmm... gah... Ah well this is broken indeed, forgot. Feel free to open a PR, I have too long backlog right now to do it right now.

Ufaowl commented 4 years ago

I also have this problem. No matter what I use, either

singleuser:
  image:
    name: myimage
    pullPolicy: Always
    tag: latest

or

singleuser:
  imagePullPolicy: Always

my singleuser pods always have:

kubectl get pod -o yaml jupyter-user | grep imagePullPolicy
    imagePullPolicy: IfNotPresent
    imagePullPolicy: IfNotPresent
consideRatio commented 4 years ago
singleuser:
  image:
    name: myimage
    pullPolicy: Always
    tag: latest

This is what should work in the latest release, 0.9.0-alpha.1.088.1350ad7.