[Warning] 0/1 nodes are available: 1 node(s) didn't match node selector

Hello world!

I’m following the recommendations from this optimization site after setting jupyterhub on kubernetes

but as soon as I added these lines in the config.yaml file:

userPods:
  nodeAffinity:
      matchNodePurpose: require

I start getting this error when a new user login

[Warning] 0/1 nodes are available: 1 node(s) didn't match node selector.

is this a bug? or should I do something else to make it work?

thanks for the support!!! :slight_smile:

Last time that I had this was related to the node not having a required tag. Here’s the Kubernetes doc on assigning tags.
https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

If you do a ‘kubectl describe pod podname -n namespacename’ you should be able to see the labels on the pod. Then you can do a ‘kubectl describe node nodename’ and view the tags. If you add the tag, then it should be able to schedule it on the node.

Hi @cbell !!
Thanks for the reply, what you suggest makes totally sense to me, by any chance do you know how to add ```
nodeSelector:

to the config.yaml file so that I can update the helm chart???

You would want to add it to the singleuser value in the values.yaml config you are passing. It could look something like this:

singleuser:
  nodeSelector: 
    beta.kubernetes.io/instance-type: c5.2xlarge

In this instance I was assigning the pod to a specific type of host in AWS, but you can do it with whatever labels you have setup.

To use the userPods.nodeAffinity.matchNodePurpose: require, make sure to not miss out on these relevant details for that setting.

It is about putting the user pods on dedicated nodes and enforcing it. Having dedicated nodes makes them easier to clear out and scale down.