Philipp Kyeck
Philipp Kyeck

Reputation: 18820

kubernetes: how to make sure that no user pods are run on master

I'm currently using Kubernetes for our staging environment - and because it is only a small one, I'm only using one node for master and for running my application pods on there.

When we switch over to production, there will be more than one node - at least one for master and one bigger node for the application pods. Do I have to make sure that all my pods are running on a different node than master or does Kubernetes take care of that automagically?

Upvotes: 2

Views: 749

Answers (2)

Colin Ryan
Colin Ryan

Reputation: 36

you can add the --register-schedulable=false parameter to the kubelet running on your master.

Upvotes: 0

Anirudh Ramanathan
Anirudh Ramanathan

Reputation: 46728

If you look at the output of kubectl get nodes, you'll see something like:

~ kubectl get nodes
NAME                                     STATUS                     AGE       VERSION
test-master              Ready,SchedulingDisabled   23h       v1.6.0-alpha.0.1862+59cfdfb8dba60e
test-minion-group-f635   Ready                      23h       v1.6.0-alpha.0.1862+59cfdfb8dba60e
test-minion-group-fzu7   Ready                      23h       v1.6.0-alpha.0.1862+59cfdfb8dba60e
test-minion-group-vc1p   Ready                      23h       v1.6.0-alpha.0.1862+59cfdfb8dba60e

The SchedulingDisabled tag ensures that we do not schedule any pods onto that node, and each of your HA master nodes should have that by default.

It is possible to set other nodes to SchedulingDisabled as well by using kubectl cordon.

Upvotes: 3

Related Questions