From b826b24782ce53eb92e8ea6383936cf487e0c5f2 Mon Sep 17 00:00:00 2001 From: Anoop Kumar Date: Wed, 15 Jan 2020 07:35:32 -0500 Subject: [PATCH] Looping over logs of all jobs using a single command (#18183) * Looping over logs of all jobs using a single command Using the label constuct `-l` to loop over output of all jobs (or pods) using a single command * Update content/en/docs/tasks/job/parallel-processing-expansion.md Co-Authored-By: Tim Bannister Co-authored-by: Tim Bannister --- .../en/docs/tasks/job/parallel-processing-expansion.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/content/en/docs/tasks/job/parallel-processing-expansion.md b/content/en/docs/tasks/job/parallel-processing-expansion.md index d34f6de23b..ba0dcf9605 100644 --- a/content/en/docs/tasks/job/parallel-processing-expansion.md +++ b/content/en/docs/tasks/job/parallel-processing-expansion.md @@ -120,14 +120,10 @@ process-item-banana-wrsf7 0/1 Completed 0 4m process-item-cherry-dnfu9 0/1 Completed 0 4m ``` -There is not a single command to check on the output of all jobs at once, -but looping over all the pods is pretty easy: +We can use this single command to check on the output of all jobs at once: ```shell -for p in $(kubectl get pods -l jobgroup=jobexample -o name) -do - kubectl logs $p -done +kubectl logs -f -l jobgroup=jobexample ``` The output is: