Jupyterhub for Kubernes: How to avoid Image Prepull on specific nodes

Hello everyone,

I have a custom Kubernetes cluster with several nodes, each node has assigned some tags to differenciate between them with a Kubernetes label selector (nodeSelector), being one of them PU = “gpu” || “cpu”. I have also deployed a Jupyterhub environment on my cluster. However I am having trouble with the deployments of different profiles (singleUser.profileList) on different nodes.

More specifically, I would like to have a profile assigned to nodes with PU: “cpu” and other profile assigned to nodes with PU: “gpu”, in order to take advantage of the GPU when deploying notebooks. In the “cpu” profile I have to select the intel version of the docker image, whereas in the “gpu” profile I need a specific ARM (+ NVIDIA) docker image since the node is deployed on an arm-based machine. I believe I have configured properly each profile so that the user server is deployed in the proper nodes, with the nodeSelector tag (see below).

The problem comes with the Jupyterhub image prepuller. I have seen that it tries to pull all the images of every profile in every node, even though the nodeSelector tag is configured. Then, in the arm/gpu node it tries to prepull the image of the intel/cpu node , and on this node it tries to pull the arm/gpu image, ending up in an unsuccessfull installation and jupyterhub not being deployed on the cluster.

Is this a bug or a misconfiguration?

My configuration:


    ARCH: "intel"
    LAYER: "cloud"
  defaultUrl: "/lab"
    name: easierai/jupyterhub-core
    tag: latest
    - display_name: "environment"
      description: "Environment preconfigured ."
      default: true
        PU: "cpu"
    - display_name: "Minimal Environment"
      description: "Only default libraries installed."
        image: jupyter/minimal-notebook
          PU: "cpu"
    - display_name: "one NVIDIA"
      description: "ARM, GPU"
        image: step21/jupyter-minimal-notebook:arm64
          PU: "gpu"
            nvidia.com/gpu: 1

See issue: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/1739