Skip to content

kubectl get pods

kubectl get pods is a command used to list Pod resources within a Kubernetes cluster^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md].

Usage

When executed without additional arguments, the command lists resources in the default namespace^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md].

Output Columns

The command returns a table containing the following columns^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md]:

  • NAME: The name of the Pod.
  • READY: The ratio of ready containers to total containers (e.g., 1/1).
  • STATUS: The current phase of the Pod (e.g., Running).
  • RESTARTS: The number of times the containers in the Pod have restarted.
  • AGE: The amount of time the Pod has been running.

Example

The following example demonstrates the output after creating a Pod named mynginx^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md]:

NAME      READY   STATUS    RESTARTS   AGE
mynginx   1/1     Running   0          40s
  • kubectl run: Used to create a new Pod^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md].
  • kubectl describe pod: Provides detailed information about a specific Pod^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md].

Sources

^[400-devops__06-Kubernetes__k8s-learning__03.pod__README.md]