Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Useful kubectl commands

Useful kubectl commands not in the kubectl Cheat Sheet:

List all nodes and their external IP

kubectl get nodes -o jsonpath='{range .items[*]}{}{"\t"}{.status.addresses[?(@.type=="ExternalIP")].address}{"\n"}{end}'

List all running Pods and their IP

kubectl get pods --all-namespaces -o jsonpath='{range .items[?(@.status.phase=="Running")]}{}{"\t"}{.status.podIP}{"\n"}{end}'

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