title: How to list all containers running in a pod, including init containers?
body: <p>A solution to retrieve all containers running in a pod is to run <code>kubectl get pods POD_NAME_HERE -o jsonpath={.spec.containers[*].name}</code>, however this command line does not provide the init containers.</p>
  
  <p>Is there a way to cleanly retrieve all containers running in a pod, including init containers?</p>
  
  <p>[edit] as svenwltr noted, on Kubernete 1.6.0 or higher, it is possible to retrieve the init container with <code>kubectl get pods POD_NAME_HERE -o jsonpath={.spec.initContainers[*].name}</code> and all containers can be retrieved with <code>kubectl get pod POD_NAME_HERE -o jsonpath="{.spec['containers','initContainers'][*].name}"</code>. However, this is not a valid workaround for lower versions of Kubernetes where <code>.spec.initContainers</code> isn't implemented yet.</p>