Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove node-role.kubernetes.io/master:NoSchedule taint

What CLI command can I type to remove the node-role.kubernetes.io/master:NoSchedule taint from the master node in a Kubernetes cluster?

The following command is failing:

[lnxcfg@ip-10-0-0-193 ~]$ kubectl taint nodes $(kubectl get nodes --selector=node-role.kubernetes.io/master | awk 'FNR==2{print $1}') key:node-role.kubernetes.io/master:NoSchedule-
error: invalid taint effect: node-role.kubernetes.io/master, unsupported taint effect

As you can see below, I am able to get the name of the master node successfully by using the following command, which is also embedded in the above failing command:

[lnxcfg@ip-10-0-0-193 ~]$ kubectl get nodes --selector=node-role.kubernetes.io/master | awk 'FNR==2{print $1}'
ip-10-0-0-193.us-west-2.compute.internal

This is an AWS Linux 2 node hosting the master node of a single master Kubernetes cluster.

like image 339
CodeMed Avatar asked Mar 15 '19 23:03

CodeMed


People also ask

How do you remove taint from master node in Kubernetes?

Remove a taint from a node You can use kubectl taint to remove taints. You can remove taints by key, key-value, or key-effect. Note: Starting in GKE version 1.22, cluster autoscaler combines existing node and node pool information to represent the whole node pool.

What is taint node in Kubernetes?

Node affinity is a property of Pods that attracts them to a set of nodes (either as a preference or a hard requirement). Taints are the opposite -- they allow a node to repel a set of pods. Tolerations are applied to pods. Tolerations allow the scheduler to schedule pods with matching taints.

How do you check taint nodes in Kubernetes?

We can do this by using the kubectl taint command. The above taint has a key name app , with a value frontend , and has the effect of NoSchedule , which means that no pod will be placed on this node until the pod has defined a toleration for the taint. We will see what the toleration looks like in later steps.


1 Answers

Below command can be used to remove taint from node.

kubectl taint nodes controlplane node-role.kubernetes.io/master:NoSchedule- 
like image 135
Dhiraj Bansal Avatar answered Sep 30 '22 15:09

Dhiraj Bansal