Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubernetes list all running pods name

Tags:

kubernetes

I looking for the option to list all pods name

How to do without awk (or cut). Now i'm using this command

kubectl get --no-headers=true pods -o name | awk -F "/" '{print $2}' 
like image 360
Ali SAID OMAR Avatar asked Mar 04 '16 13:03

Ali SAID OMAR


People also ask

How do I know which node pods are running?

To find the cluster IP address of a Kubernetes pod, use the kubectl get pod command on your local machine, with the option -o wide . This option will list more information, including the node the pod resides on, and the pod's cluster IP. The IP column will contain the internal cluster IP address for each pod.

Which command gets list of pods?

To list one or more pods, replication controllers, services, or daemon sets, use the kubectl get command.

Which Kubernetes command retrieves all running pods in a namespace?

The most basic command for viewing Kubernetes objects via kubectl is get . If you run kubectl get <resource-name> you will get a listing of all resources in the current namespace. If you want to get a specific resource, you can use kubectl get <resource-name> <object-name> .


1 Answers

Personally I prefer this method because it relies only on kubectl, is not very verbose and we don't get the pod/ prefix in the output:

kubectl get pods --no-headers -o custom-columns=":metadata.name" 
like image 199
juancho85 Avatar answered Oct 17 '22 00:10

juancho85