Hey all, I am trying to schedule my nginx po to run in the controlplane node (th . . .

SaidBen:
Hey all, I am trying to schedule my nginx po to run in the controlplane node (this is the first lab in Scheduling section) but not working. I’ve added the toleration and nodeName already. The po keeps landing on node01 instead.
Toleration in my po
tolerations:
- key: "<http://node-role.kubernetes.io/master|node-role.kubernetes.io/master>"
operator: "Exists"
effect: "NoSchedule"

Taint in the controlplane node:
taints:
- effect: NoSchedule
key: <http://node-role.kubernetes.io/master|node-role.kubernetes.io/master>

Fernando Jimenez:
Tolerations in a pod definition will not guarantee that it will land in the node with that taint. Think of it, if you will, like just permission to do so. If you want that pod to land in the selected node, you need as well node affinity or nodeSelector.

SaidBen:
yes you are absolutely correct, but Iv already added the nodeName as mentioned in my post
spec:
nodeName: controlplane

Karim Meslem:
try nodeSelector instead of nodeName?

SaidBen:
Just watched the solution video, all what they did is add the nodeName: controlplane but that would not work since the controlplane is tainted; they never showed that the po was successfully scheduled on controlpane. @Karim Meslem i do not think that would make a difference, the only difference is that nodeSelector uses a label to select a node instead of hard-coding the nodeName into the po manifest

Mayur Sharma:
@SaidBen I see you already mentioned it is on node01.
Can you check the taints on both?
And, if you have mentioned the nodeName as controlplane, it cannot be scheduled on other node.

Hope you are checking the same pod :slightly_smiling_face:

SaidBen:
done that already

tolerations:
- key: "<http://node-role.kubernetes.io/master|node-role.kubernetes.io/master>"
operator: "Exists"
effect: "NoSchedule"

Taint in the controlplane node:
taints:
- effect: NoSchedule
key: <http://node-role.kubernetes.io/master|node-role.kubernetes.io/master>

Mayur Sharma:
please share the whole pod.yaml file

SaidBen:
sorry already exited the lab and cannt recover the yaml

SaidBen:
thanks @Mayur Sharma

Fernando Jimenez:
Oh, no! Another mystery that it will go into history as unsolved. No doubt many conspiracies theories will develop afterward.
Just joking. :smile:

unnivkn:
if the question is : you must schedule master node then no toleration is needed. Only use nodeName. if the question is : You may have to schedule either master or other nodes, then toleration helps. nodeName is manual scheduling it overrides tolerations.