A container’s ready condition indicates whether that container is ready to serve its intended workload. Kubernetes reports it in the container status within the Pod object, alongside the container state, image, container ID, and restart count. section 6.1.3
Readiness is separate from the container’s current state. A container may be Running but not ready, while its state explains whether it is Waiting, Running, Terminated, or Unknown. The ready value focuses on whether the container can serve workload traffic. section 6.1.3
Inspect container readiness at different levels:
- Use kubectl describe po <pod-name> to view each container’s state, Ready value, and restart count. section 6.1.3
- Use kubectl get po <pod-name> -o json | jq .status.containerStatuses to inspect the structured status for individual containers. section 6.1.3
Reading a container status
In kubectl describe po kiada, State: Running and Ready: True show that the container is running and reported ready; Restart Count: 0 shows that it has not restarted.
$ kubectl describe po kiada
...
Containers:
kiada:
Container ID: docker://c64944a684d57faacfced0be1af44686...
Image: luksa/kiada:0.1
Image ID: docker-pullable://luksa/kiada@sha256:3f28...
Port: 8080/TCP
Host Port: 0/TCP
State: Running #1
Started: Sun, 02 Feb 2020 12:43:03 +0100 #1
Ready: True #2
Restart Count: 0 #3
Environment: <none>
...
Browse a concrete kubectl output listing the container ID, image, state, readiness, and restart count. section 6.1.3
