Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save HariSekhon/3b2e2de7327d42e7e7a4442f3b51488b to your computer and use it in GitHub Desktop.
Save HariSekhon/3b2e2de7327d42e7e7a4442f3b51488b to your computer and use it in GitHub Desktop.
Get all Kubernetes pods and IPs
kubectl get pods -o json --all-namespaces | jq -r '.items[] | [.metadata.namespace, .metadata.name, .status.podIP] | @csv'
@HariSekhon
Copy link
Author

Adapted from my script for pod IPs at a connection's request:

https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/kubernetes/kubectl_pod_ips.sh

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