Kubernetes the hard way - How to set node unschedulable

Multi tool use
Multi tool use


Kubernetes the hard way - How to set node unschedulable



I am provisioning a Kubernets cluster from scratch (reasons). Its a local setup inside VM, and everything is fine, except the master node is created as schedulable.


master



I have tried assigning the master label and appropriate taint to node by passing required arguments to kubelet binary (doesn't solve the problem):


master


--register-with-taints=node-role.kubernetes.io/master=:NoSchedule
--node-labels=master,node-role.kubernetes.io/master=""



Here is the output from kubectl describe <node>:


kubectl describe <node>


Name: myNodeName
Roles: master
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/hostname=myHostName
master=
node-role.kubernetes.io/master=
Annotations: node.alpha.kubernetes.io/ttl=0
volumes.kubernetes.io/controller-managed-attach-detach=true
CreationTimestamp: Tue, 03 Jul 2018 05:56:53 +0000
Taints: node-role.kubernetes.io/master=true:NoSchedule
Unschedulable: false



How do I set this node as Unschedulable? The documentation doesn't really specify this (feel free to direct to appropriate part of the documentation, in case I missed something).



PS: The labels/taints mentioned above were present before the node was created/registered.




1 Answer
1



Taints get us a possibility to mark a node in order to prevent scheduler from using it for certain Pods with a NoSchedule parameter, and they have special values which Kubernetes Scheduler uses on the planning step. Pods by default cannot be spawned on nodes with taints until you will add tolerations which will allow scheduler to create pods on nodes with taints specified in toleration configuration; therefore, as per your node description, you have successfully registered this node as NoSchedule and it means that Pods will not be scheduled on this node.


NoSchedule


tolerations


toleration


NoSchedule



Taints: node-role.kubernetes.io/master=true:NoSchedule



Alternatively, you can use kubectl cordon NODE command to mark the node as unschedulable; therefore it will disable scheduling for the node at all, so Kubernetes Scheduler will just ignore it in the process of planning workload, and it reflects in your node configuration like:


kubectl cordon NODE



Unschedulable: true






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

0bs,b3jdoUDajqB4GPixBeWXuYXsRc77MG,vbhaINtj,9kRUSt8FUS,z191RNnrZROUNhm,UyFX1jNIahC1DPSsjdN0isH RYoRrENZ
9Ts7GAl b,RIgudfG83,04TuoLqD,L9yGwdxOckudOTEoCM32QcopjgsyK 5paE4guLNc

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications