Skip to content

Instantly share code, notes, and snippets.

@joerx
Last active October 26, 2018 02:27
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 joerx/25391497674f822fb4637d8587bd0f39 to your computer and use it in GitHub Desktop.
Save joerx/25391497674f822fb4637d8587bd0f39 to your computer and use it in GitHub Desktop.
Get k8s masters from node list, output name
kubectl get node -o json | jq -r '.items[] | select(.metadata.labels["kubernetes.io/role"] == "master") | .metadata.name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment