Wednesday, November 21, 2018

The Easy Way To Let Kubernetes Master Node To Run Pods


   By default, as Kubernetes master node has quite heavy admin load, so it normally does not  run other work pods.  However when we don't have many nodes, so we would like to let master node to run some workload too ,specially in Dev and Stage enviroments.


    There are a few ways to do that. The easy way is to remove the taint of the master node.
Default, master has taint like this:
kubectl describe node <master node>  |grep -i taint

We remove it via kubectl
kubectl taint nodes <master node>
node "<master node>" untainted
kubectl taint nodes <master node>
node "<master node>" untainted
When we scale up pods, some of them will run on master node

We can add it back via kubectl
 kubectl taint nodes<master node>
node "<master node>" tainted

We can  use taint to prevent pod schedules on normal worker node as well.
kubectl taint nodes <node> key=value:NoSchedule

No comments: