Taint and Toleration
Get taints from node
kubectl get nodes NODE -o yaml | yq .spec.taints
kubectl get nodes -o yaml | yq '.items[].spec.taints'
# kubectl get nodes -o json | jq '.items[].spec.taints'
kubectl get nodes -o='custom-columns=NodeName:.metadata.name,TaintKey:.spec.taints[*].key,TaintValue:.spec.taints[*].value,TaintEffect:.spec.taints[*].effect'
Ignore KEY=LABEL labeled pod to be scheduled in specified NODE
kubectl taint nodes NODE KEY=LABEL:NoSchedule
Remove taint
kubectl taint nodes NODE KEY=LABEL:NoSchedule-
NODE=master
kubectl taint nodes $NODE node-role.kubernetes.io/control-plane:NoSchedule-
Taint toleration
spec:
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"