Kubernetes 101 : Scheduling a pod on the kubernetes master node



Usually pods are not scheduled on the master node, but if for whatever reason we need to do it, we would start by looking for the taints of the master node.


Next, we will need to add a "toleration" for the taint of the master node to the pod we want to schedule on the master node.

We first look for the master node using the below command:


Then we get the taint of our master node using the below command:


We can also get the labels of our master node using the below command:


Below is the YAML file of our pod:


Remark:

Toleration might not be enough for the pod to be scheduled on the master node, we also use the nodeSelector parameter that tells kubernetes to schedule a pod on a node that has a label that matches the nodeSelector of the pod.

Then we create our pod using the below command:


We then check if our pod was scheduled on the master node using the "wide" display option:



Comments

Leave as a comment:

Archive