Skip to content

Instantly share code, notes, and snippets.

@ykfq
Last active September 7, 2022 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ykfq/4ffb4e31d6004d09f1abbb0d7f30f48d to your computer and use it in GitHub Desktop.
Save ykfq/4ffb4e31d6004d09f1abbb0d7f30f48d to your computer and use it in GitHub Desktop.
Get the taints on all nodes in one command.
root@master001:~# kubectl describe node | egrep "Taints"
Taints: gpu=yes:NoSchedule
Taints: <none>
Taints: <none>
Taints: <none>
Taints: node-role.kubernetes.io/master:NoSchedule
Taints: node-role.kubernetes.io/master:NoSchedule
Taints: node-role.kubernetes.io/master:NoSchedule
Taints: <none>
Taints: <none>
#---------- or -----------
kubectl describe node | egrep "Name:|Taints"
@nilijev
Copy link

nilijev commented Sep 7, 2022

it shows only the first taint

@nilijev
Copy link

nilijev commented Sep 7, 2022

kubectl get nodes -o custom-columns=NAME:metadata.name,TAINT:spec.taints[].effect,KEY:spec.taints[].key,VALUE:spec.taints[*].value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment