Kubernetes: list all pods and its nodes

testTester :

I have 3 nodes, running all kinds of pods. I would like to jave a list of nodes and pods, for an example:

NODE1 POD1
NODE1 POD2
NODE2 POD3
NODE3 POD4

How can this please be achieved?

Thanks.

nickgryg :

You can do that with custom columns:

kubectl get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespaces

or just:

kubectl get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name --all-namespaces

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I list all kubernetes nodes and sort by the nodes that have the most pods?

kubernetes pods/nodes is forbidden

kubernetes list all running pods name

Kubernetes DaemonSet Pods schedule on all nodes expect one

Get list of all pods (including deleted) for kubernetes cluster? (AWS EKS)

How to list names of all pods serving traffic behind a service in kubernetes

How to connect to an existing kubernetes server and list all pods using java?

Kubernetes - How to list all pods running in a particular instance group?

How to order pods based on the nodes in kubernetes

Kubernetes not spreading pods across available nodes

Kubernetes prometheus metrics for running pods and nodes?

Kubernetes API - gets Pods on specific nodes

Does Kubernetes move pods between nodes or is the Replica Set that recreates the pods?

Kubernetes can not list pods as user

Kubernetes API: list pods with a label

How to delete replication controller and its pods in kubernetes?

Command to delete all pods in all kubernetes namespaces

how to assign affinity to kubernetes pods for distributing the pods across all ads?

Kubernetes - Shared environment variables for all Pods

Communicating to all Kubernetes pods behind a service

Running a command on all kubernetes pods of a service

prometheus cannot able to monitor all the pods in kubernetes

Print all pods along with cpu requirements kubernetes

Kubernetes spread pods across nodes using podAntiAffinity vs topologySpreadConstraints

Does Kubernetes HPA increase number of nodes or just number of pods?

GCP Kubernetes spreading pods across nodes instead of filling available resources

Kubernetes: Run Pods only on EC2 Nodes that have GPUs

Kubernetes: Nodes/Pods not showing with kubectl after building cluster with kubeadm

No data points for Kubernetes Pods and nodes in Grafana - Prometheus Dashboard