From 481eff63217fc120aec6b45257db7beadbd454cf Mon Sep 17 00:00:00 2001 From: Bruno Saboia Date: Wed, 16 Feb 2022 16:35:46 -0300 Subject: [PATCH] Add multi-container info on pod failure docs --- .../determine-reason-pod-failure.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/en/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md b/content/en/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md index f1ddd96389..bb0c730f59 100644 --- a/content/en/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md +++ b/content/en/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md @@ -75,6 +75,11 @@ only the termination message: kubectl get pod termination-demo -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}" +1. 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 (please note that the `multi-container-pod` creation is not covered in this exercise): + + kubectl get pod multi-container-pod -o go-template='{{range .status.containerStatuses}}{{printf "%s:\n%s\n\n" .name .lastState.terminated.message}}{{end}}' + + ## Customizing the termination message Kubernetes retrieves termination messages from the termination message file