In the exam, to schedule a pod in the controlplane should we remove the taint “http://node-role.kubernetes.io/master:NoSchedule|node-role.kubernetes.io/master:NoSchedule” and use nodeSelector or use tolerations and nodeSelector? which approach would be better?
add toleration and nodeselection in pod
you can also use
nodeName: controlplane in pod spec.
Hi @Sangeetha Radhakrishnan
Remove taints out of a node if you are explicitly asked, since this will affect other pods already scheduled on it. Adding toleration and nodeSelector or node affinity would almost always the intend in a test.
nodeName is a manual intervention, not usually done, because you want the scheduler controller to do the work.
I agree with Fernando. Toleration + Node selector will do the magic. Toleration alone won’t ensure the pod scheduling (it may or may not). k get node master --show-labels k describe node master | grep -i taint -A4 . Add both nodeSelecor & toleration in your pod based on this.
In the exam, where you need to answer questions with speed, nodeName is enough. NodeSelector/Affinity and Tolerations, while allowing the scheduler to do its job, are more verbose and require more steps to be performed. Many of the questions will only be analyzed the result. So if you were just asked to start a POD on the controlplane, it makes no difference to use NodeSelector, Affinity, Tolerations or nodeName.
Hi… it depends on the %of marks. if it is 1 or 2% then you are right.
Thank you all for the replay!