If in CKAD its asked to add pod to master nod and if i just add below in my pod yaml
nodeName: controlplane is it okay or i would need to add tolerations ?
nodeName: controlplane also i was able to create pod on master node without adding tolerations and its easy
AFAIK, just adding a node name would work if and only if there are no taints on the master node. I believe in most clusters, there is a NoSchedule taint set on the master node so that no pods (other than the management plane elements) are placed on the master node.
Consider a toleration as an antidote to a taint - So you’d only need a toleration if you want your pods to be scheduled on a node in spite of a specific taint
A NoSchedule taint on a node does not seem to prevent running a Pod on that node if a
nodeName is specified in the pod definition (I tested this). The docs say this:
nodeName is a field of PodSpec. If it is non-empty, the scheduler ignores the pod and the kubelet running on the named node tries to run the pod.
From what I understand, taints and tolerations are checked by the scheduler, but since
nodeName bypases the scheduler entirely, they don’t have any effect.
@Tim Exactly , so if exam ask just to run any pod on master node , even if there are taints on master node with nodeName in pod defination its able to schedule on master node , i had tried this in lab and it works , hence the question was whether exam will just check the pod status on master node or it will check whether had used tolerations as well , if question is just to run pod on master node