Verifying application health
In this section, we are going to review how application Pods are considered healthy. Pods always start in the Pending
state and continue to the Running
state once the main container is considered healthy. If the Pod executes a Service process, it will stay in this Running
state. If the Pod is associated with a Job resource, it may end successfully (the Succeeded
state) or fail (the Failed
state).
If we remove a Pod resource, it will go to Terminating
until it is completely removed from Kubernetes.
Important note
If Kubernetes cannot retrieve the Pod’s status, its state will be Unknown
. This is usually due to communication issues between the hosts’ kubelet and the API server.
Kubernetes reviews the state of the containers to set the Pod’s state, and containers can be either Waiting
, Running
, or Terminated
. We can use kubectl describe pod <POD_NAME>
to review the details of these phases. Let’s quickly review these...