user4889345
user4889345

Reputation:

Kubernetes - How to know which minions are hosting Pods

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 ?

Upvotes: 2

Views: 843

Answers (2)

Petko M
Petko M

Reputation: 724

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

Upvotes: 0

Janos Lenart
Janos Lenart

Reputation: 27100

Just add -o wide:

kubectl get pod -o wide

Upvotes: 1

Related Questions