Skip to content

Commit fe955d4

Browse files
authored
Merge pull request #31768 from brunosaboia/31543-add-multi-container-debug-info
Add multi-container info on pod failure docs
2 parents 2f42f78 + d1f511f commit fe955d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

content/en/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ only the termination message:
7575

7676
kubectl get pod termination-demo -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}"
7777

78+
If you are running a multi-container pod, you can use a Go template to include the container's name. By doing so, you can discover which of the containers is failing:
79+
80+
```shell
81+
kubectl get pod multi-container-pod -o go-template='{{range .status.containerStatuses}}{{printf "%s:\n%s\n\n" .name .lastState.terminated.message}}{{end}}'
82+
```
83+
7884
## Customizing the termination message
7985

8086
Kubernetes retrieves termination messages from the termination message file

0 commit comments

Comments
 (0)