Skip to content

Instantly share code, notes, and snippets.

@dlinsley
Last active May 9, 2018 04:48
Show Gist options
  • Save dlinsley/1803cc8af484f985ce8cd71019474887 to your computer and use it in GitHub Desktop.
Save dlinsley/1803cc8af484f985ce8cd71019474887 to your computer and use it in GitHub Desktop.
Get Kubernetes Node IPs as JSON array with kubectl and jq
kubectl get nodes -o json | jq '.items[] | .status .addresses[] | select(.type=="ExternalIP") | .["address"]' | jq . -s -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment