Kubernetes - How to know which minions are hosting Pods

3/30/2017

I have a 6 minion cluster and would like to know how many of these minions are actually hosting pods at any given time. Is there a specific command for that ? Right now Im using a very generic command.

kubectl get po | grep Running > RUNNING.txt
for i in `cat RUNNING.txt `; do kubectl describe po $i; done | grep "Started container with docker

"

Any direct command to fetch the info I want ?

--
kubectl
kubernetes
kubernetes-health-check

2 Answers

3/31/2017

This command will print all the nodes that have pods running on them:

kubectl get pods -o jsonpath='{range .items[*]}{.spec.nodeName} {end}' | tr " " "\n" | sort | uniq
-- Petko M
Source: StackOverflow

3/30/2017

Just add -o wide:

kubectl get pod -o wide
-- Janos Lenart
Source: StackOverflow