From 481eff63217fc120aec6b45257db7beadbd454cf Mon Sep 17 00:00:00 2001 From: Bruno Saboia Date: Wed, 16 Feb 2022 16:35:46 -0300 Subject: [PATCH 1/5] 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 From 25aa381f755308bb6d28157138edd6911342db11 Mon Sep 17 00:00:00 2001 From: Bruno Saboia Date: Tue, 22 Feb 2022 12:55:58 -0300 Subject: [PATCH 2/5] Put multi-container info outside numbered list --- .../debug-application-cluster/determine-reason-pod-failure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bb0c730f59..43172b1086 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,7 +75,7 @@ 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): + 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}}' From 24444fab326cccf811cfbf5cf7dafc827559bcd9 Mon Sep 17 00:00:00 2001 From: Bruno Saboia Date: Tue, 22 Feb 2022 16:48:57 -0300 Subject: [PATCH 3/5] Remove unecessary additional info --- .../debug-application-cluster/determine-reason-pod-failure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 43172b1086..b0f409ca14 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,7 +75,7 @@ only the termination message: kubectl get pod termination-demo -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}" - 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): + 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: kubectl get pod multi-container-pod -o go-template='{{range .status.containerStatuses}}{{printf "%s:\n%s\n\n" .name .lastState.terminated.message}}{{end}}' From dd3e660cfefffc34755d7ba86923e97a592b2fd0 Mon Sep 17 00:00:00 2001 From: Bruno Saboia Date: Wed, 23 Feb 2022 17:22:05 -0300 Subject: [PATCH 4/5] Remove useless whitespace --- .../debug-application-cluster/determine-reason-pod-failure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b0f409ca14..b7d306fa64 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,7 +75,7 @@ only the termination message: kubectl get pod termination-demo -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}" - 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: +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: kubectl get pod multi-container-pod -o go-template='{{range .status.containerStatuses}}{{printf "%s:\n%s\n\n" .name .lastState.terminated.message}}{{end}}' From d1f511f92c75a688e5a27347039f24dd5065b531 Mon Sep 17 00:00:00 2001 From: Bruno Saboia Date: Thu, 24 Feb 2022 09:09:06 -0300 Subject: [PATCH 5/5] Use explicit backticks for shell content --- .../determine-reason-pod-failure.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 b7d306fa64..9a01b37e19 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 @@ -77,8 +77,9 @@ only the termination message: 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: - kubectl get pod multi-container-pod -o go-template='{{range .status.containerStatuses}}{{printf "%s:\n%s\n\n" .name .lastState.terminated.message}}{{end}}' - +```shell +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