How to See Which Pods Are Running on Which Nodes in Kubernetes
In a Kubernetes cluster, it’s often useful to know which pods are running on which nodes—especially when you’re troubleshooting, monitoring resource usage, or checking your scheduling strategy. Thankfully, Kubernetes makes it simple with one powerful command.
🧾 Use the kubectl get pods
Command
To see all pods across the cluster along with their assigned nodes, run:
kubectl get pods -o wide
✅ Sample Output:
NAME READY STATUS RESTARTS AGE IP NODE
nginx-6db489d4b7-pj2z6 1/1 Running 0 3h 10.244.1.12 masternode
app-backend-5f79d7cbb8-vh2w8 1/1 Running 0 2h 10.244.2.4 main02.prod.ken1.hostraha.com
What Each Column Means:
- NAME: The name of the pod
- READY: How many containers in the pod are ready
- STATUS: The overall pod status (e.g., Running, Pending, CrashLoopBackOff)
- RESTARTS: How many times the pod has restarted
- AGE: How long the pod has been running
- IP: Internal IP address of the pod
- NODE: The node where the pod is currently scheduled
🎯 Filter by Namespace (Optional)
If your pods are in a specific namespace, just add the -n
flag:
kubectl get pods -n my-namespace -o wide
🎯 Filter by Label (Optional)
If you’re tracking a specific app or deployment:
kubectl get pods -l app=my-app -o wide
💡 Pro Tip: Watch in Real-Time
To keep an eye on your pods as they change (e.g., during rolling updates):
kubectl get pods -o wide --watch
🔐 Final Thoughts
Knowing which pods are scheduled on which nodes helps you understand your cluster’s behavior, balance workloads, and debug issues faster. It’s a small command with a big impact in day-to-day cluster operations.
If you want to go deeper—like checking node resource usage or pod-to-node affinities—tools like kubectl top
or metrics server integrations can help.