Created
November 9, 2023 03:43
-
-
Save zulhfreelancer/d38d5e7e48288a80c95f04394abed2a3 to your computer and use it in GitHub Desktop.
List all Kubernetes nodes by a specific taint(s)
This file contains 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
# Search by key | |
kubectl get nodes -o json | jq -r '.items[] | select(.spec.taints[]? | select(.key == "foo/bar")) | .metadata.name' | |
# Search by key and value | |
kubectl get nodes -o json | jq -r '.items[] | select(.spec.taints[]? | select(.key=="foo/bar" and .value=="baz")) | .metadata.name' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment