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

**URL:** https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183
**Category:** Zero to JupyterHub on Kubernetes
**Created:** [September 19, 2019, 4:46pm UTC](https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183 "2019-09-19T16:46:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jpmolinamatute](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jpmolinamatute/32/1111_2.png) [@jpmolinamatute](https://discourse.jupyter.org/u/jpmolinamatute)
#### Post date: [September 19, 2019, 4:46pm UTC](https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183/1 "2019-09-19T16:46:51Z")

</div>

Hello world!

I’m following the recommendations from [this optimization](https://zero-to-jupyterhub.readthedocs.io/en/latest/optimization.html) 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!!! 🙂

---

<div class="post-metadata">

### Author: ![cbell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/cbell/32/1079_2.png) [@cbell](https://discourse.jupyter.org/u/cbell)
#### Post date: [September 19, 2019, 7:50pm UTC](https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183/2 "2019-09-19T19:50:38Z")

</div>

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/](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.

---

<div class="post-metadata">

### Author: ![jpmolinamatute](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jpmolinamatute/32/1111_2.png) [@jpmolinamatute](https://discourse.jupyter.org/u/jpmolinamatute)
#### Post date: [September 20, 2019, 2:12pm UTC](https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183/3 "2019-09-20T14:12:22Z")

</div>

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

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

---

<div class="post-metadata">

### Author: ![cbell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/cbell/32/1079_2.png) [@cbell](https://discourse.jupyter.org/u/cbell)
#### Post date: [December 4, 2019, 5:41pm UTC](https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183/4 "2019-12-04T17:41:01Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![consideRatio](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/consideratio/32/1033_2.png) [@consideRatio](https://discourse.jupyter.org/u/consideRatio)
#### Post date: [December 26, 2019, 11:56pm UTC](https://discourse.jupyter.org/t/warning-0-1-nodes-are-available-1-node-s-didnt-match-node-selector/2183/5 "2019-12-26T23:56:22Z")

</div>

To use the `userPods.nodeAffinity.matchNodePurpose: require`, make sure to not miss out on [these relevant details for that setting](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/optimization.html#using-a-dedicated-node-pool-for-users).

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.
