Created
May 6, 2024 17:03
-
-
Save rjchicago/ce37a06ae38733cc976f42756c8fb1fe to your computer and use it in GitHub Desktop.
K8s: List nodes with taints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list taints (all nodes) | |
kubectl get nodes -o json | jq -r '.items[] | .metadata.name + " " + .spec.taints[]?.key + "=" + .spec.taints[]?.key + ":" + .spec.taints[]?.effect' | |
# list taints (exclude control plane) | |
kubectl get nodes -o json -l '!node-role.kubernetes.io/control-plane' | jq -r '.items[] | .metadata.name + " " + .spec.taints[]?.key + "=" + .spec.taints[]?.key + ":" + .spec.taints[]?.effect' | |
# remove taint example (note: the hyphen after the taint to remove) | |
# kubectl taint nodes $NODE $TAINT- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment