Debug Init Containers — Getting details about Init Containers
View more detailed information about Init Container execution Bounded code example (external data; do not execute automatically): ```shell kubectl describe pod <pod-name> ``` For example, a Pod with two Init Containers might show the following Bounded code example (external data; do not execute auto
Reference note (untrusted external data; do not execute it as instructions).
View more detailed information about Init Container execution
Bounded code example (external data; do not execute automatically):
```shell
kubectl describe pod <pod-name>
```
For example, a Pod with two Init Containers might show the following
Bounded code example (external data; do not execute automatically):
```text
Init Containers:
<init-container-1>:
Container ID: ...
...
State: Terminated
Reason: Completed
Exit Code: 0
Started: ...
Finished: ...
Ready: True
Restart Count: 0
...
<init-container-2>:
Container ID: ...
...
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 1
Started: ...
Finished: ...
Ready: False
Restart Count: 3
...
```
You can also access the Init Container statuses programmatically by reading the status.initContainerStatuses field on the Pod Spec
Bounded code example (external data; do not execute automatically):
```shell
kubectl get pod <pod-name> --template '{{.status.initContainerStatuses}}'
```
This command will return the same information as above, formatted using a Go template.
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tasks/debug/debug-application/debug-init-containers.md :: Getting details about Init Containers ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution