kubernetes status init troubleshoot

PHOTO EMBED

Sat Oct 23 2021 05:30:52 GMT+0000 (Coordinated Universal Time)

Saved by @firdauslazim

Gathering information
For those scenario the best would be to gather information, as the root cause can be different in every PodInitializing issue.

kubectl describe pods pod-XXX with this command you can get many info of the pod, you can check if there's any meaningful event as well. Save the init container name

kubectl logs pod-XXX this command prints the logs for a container in a pod or specified resource.

kubectl logs pod-XXX -c init-container-xxx This is the most accurate as could print the logs of the init container. You can get the init container name describing the pod in order to replace "init-container-XXX" as for example to "copy-default-config" as below:
content_copyCOPY

Gathering information For those scenario the best would be to gather information, as the root cause can be different in every PodInitializing issue. kubectl describe pods pod-XXX with this command you can get many info of the pod, you can check if there's any meaningful event as well. Save the init container name kubectl logs pod-XXX this command prints the logs for a container in a pod or specified resource. kubectl logs pod-XXX -c init-container-xxx This is the most accurate as could print the logs of the init container. You can get the init container name describing the pod in order to replace "init-container-XXX" as for example to "copy-default-config" as below:

https://stackoverflow.com/questions/50075422/kubernetes-pods-hanging-in-init-state