Erika
Erika

Reputation: 599

How to schedule pods on Kubernetes master?

In my Kubernetes cluster, I have 3 worker node and 1 master node. I have removed the taint on the master node so the k8s can schedule pods on that node.

enter image description here

Now, I want to change 2 of 3 workers to master and control-plane (can schedule pods on these nodes)node by using the following :

kubectl label nodes node1 kubernetes.io/role=master
kubectl label nodes node1 kubernetes.io/role=control-plane
kubectl label nodes node2 kubernetes.io/role=master
kubectl label nodes node2 kubernetes.io/role=control-plane
kubectl taint node --all node-role.kubernetes.io/master:NoSchedule-

I wonder if those pods in node1(for example) would stop after I run kubectl label nodes?

Upvotes: 0

Views: 750

Answers (1)

P Ekambaram
P Ekambaram

Reputation: 17621

Use the below command to schedule pods on the master nodes

kubectl taint node <master-node> node-role.kubernetes.io/control-plane:NoSchedule-

Upvotes: 1

Related Questions