Kubectl: Get Pods – List All Pods – Kubernetes

A Pod is a group of one or more containers with shared storage, network and lifecycle and is the basic deployable unit in Kubernetes.

Each Pod is scheduled on the same Node, and remains there until termination or deletion.

In case of a Node failure, identical Pods are scheduled on other available Nodes in the cluster.

In this note i will show how to list Pods in Kubernetes cluster and how to get detailed information about them using the kubectl command.

Cool Tip: List Nodes in Kubernetes cluster! Read more →

List Pods using Kubectl

Info: Add -o wide option to the kubectl get command to get more details.

List Pods in the default Namespace for the current context:

$ kubectl get pods
$ kubectl get pods -o wide

List all Pods from all Namespaces:

$ kubectl get pods --all-namespaces 
$ kubectl get pods --all-namespaces -o wide

Get Pods from a particular Namespace:

$ kubectl get pods --namespace <namespace_name>
$ kubectl get pods --namespace <namespace_name> -o wide

Get Pods running on a specific Node:

$ kubectl get pods --field-selector spec.nodeName=<node_name>
$ kubectl get pods --field-selector spec.nodeName=<node_name> -o wide

Get detailed information about a Pod:

$ kubectl describe pod <pode_name>

Cool Tip: List Namespaces in Kubernetes cluster! Read more →

Was it useful? Share this post with the world!

2 Replies to “Kubectl: Get Pods – List All Pods – Kubernetes”

  1. $ kubectl describe pode

    Dont you mean pods?

    1. Fixed. Thanks!

Leave a Reply