liveBook · Manning

Pod phase

As explained in Kubernetes in Action, Second Edition

A pod phase is a high-level Kubernetes status value summarizing the pod's current lifecycle stage.

A pod phase is a high-level Kubernetes status value summarizing the pod’s current lifecycle stage. It appears in the Pod object’s status section and provides a quick view of what is happening, while conditions and container states explain the situation in more detail. section 6.1 section 6.1.1

A pod can have one of five phases:

  • Pending: the Pod object exists, but the pod is not yet scheduled, or its container images have not been pulled and started. section 6.1.1
  • Running: at least one container in the pod is running. section 6.1.1
  • Succeeded: every container in a non-permanent pod completed successfully. section 6.1.1
  • Failed: a non-permanent pod has at least one container that terminated unsuccessfully. section 6.1.1
  • Unknown: the Kubelet is no longer communicating the pod’s state to the API server. section 6.1.1

Inspecting a pod phase

Create a pod with kubectl apply -f pod.kiada.yaml, then inspect its phase with kubectl get po kiada -o json | jq .status.phase. A healthy pod may report phase: Running. kubectl describe po kiada also displays the status near the top. section 6.1.1

Table 6.1 List of phases a pod can be in
Pod phase
Description
Pending
The initial phase starts after the Pod object is created. Until the pod is scheduled to a node, and the images of its containers are pulled and started, it remains in this phase.
Running
At least one of the pod’s containers is running.
Succeeded
Pods that aren’t intended to run indefinitely are marked as Succeeded when all their containers complete successfully.
Failed
When a pod is not configured to run indefinitely and at least one of its containers terminates unsuccessfully, the pod is marked as Failed.
Unknown
The state of the pod is unknown because the Kubelet has stopped reporting communicating with the API server. Possibly the worker node has failed or has disconnected from the network.

Compare the five phases and their lifecycle meanings in one reference table. section 6.1.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Defines five phases and inspection commands, but defers detailed diagnosis to conditions and container states.
Examples
Uses the kiada Pod with kubectl apply, kubectl get, jq, and kubectl describe to inspect phase values.
What it assumes
Assumes familiarity with creating a Pod object and introduces phase inspection through Kubernetes status fields.
What you can do after
Diagnose/debug with it by locating a pod’s lifecycle summary through kubectl and distinguishing phase from detailed status.
How it connects
Connects pod phase with Kubernetes API objects, pod conditions, container states, Kubelets, and container lifecycle.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.