Skip to content

Instantly share code, notes, and snippets.

@georgegoh
Created March 2, 2021 07:25
Show Gist options
  • Save georgegoh/044da30fb053110c755246ea330a75b2 to your computer and use it in GitHub Desktop.
Save georgegoh/044da30fb053110c755246ea330a75b2 to your computer and use it in GitHub Desktop.
Get IP addresses of all nodes in a kubernetes cluster
kubectl get nodes -o=go-template --template='{{range .items}}{{range .status.addresses}}{{if eq .type "ExternalIP" }}{{.address}}{{printf "\n"}}{{end}}{{end}}{{end}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment