Pod is in pending stage ( Error : FailedScheduling : nodes didn't match node selector ) Pod is in pending stage ( Error : FailedScheduling : nodes didn't match node selector ) kubernetes kubernetes

Pod is in pending stage ( Error : FailedScheduling : nodes didn't match node selector )


Solution : You can do one of the two things to allow scheduler to fullfil your pod creation request.

  1. you can choose to remove these lines from your pod yaml and start your pod creation again from scratch (if you need a selector for a reason go for approach as on next step 2)

    nodeSelector:     nodePool: cluster 

or

  1. You can ensure that you add this nodePool: cluster as label to all your nodes so the pod will be scheduled by using the available selector.

You can use this command to label all nodes

kubectl label nodes <your node name> nodePool=cluster

Run above command by replacing node name from your cluster details for each node or only the nodes you want to be select with this label.


Your pod probably uses a node selector which can not fulfilled by scheduler.Check pod description for something like that

    apiVersion: v1    kind: Pod    metadata:      name: nginx      labels:        env: test    spec:      ...      nodeSelector:        disktype: ssd

And check whether your nodes are labeled accordingly.