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.
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.
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.
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.
Below command can be used to remove taint from node.
kubectl taint nodes controlplane node-role.kubernetes.io/master:NoSchedule-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With