Skip to content

Instantly share code, notes, and snippets.

@rjchicago
Created May 6, 2024 17:03
Show Gist options
  • Save rjchicago/ce37a06ae38733cc976f42756c8fb1fe to your computer and use it in GitHub Desktop.
Save rjchicago/ce37a06ae38733cc976f42756c8fb1fe to your computer and use it in GitHub Desktop.
K8s: List nodes with taints
# 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