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 <tim@scalefactory.com> Co-authored-by: Tim Bannister <tim@scalefactory.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
e4f14e1c62
commit
b826b24782
@@ -120,14 +120,10 @@ process-item-banana-wrsf7 0/1 Completed 0 4m
|
|||||||
process-item-cherry-dnfu9 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,
|
We can use this single command to check on the output of all jobs at once:
|
||||||
but looping over all the pods is pretty easy:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
for p in $(kubectl get pods -l jobgroup=jobexample -o name)
|
kubectl logs -f -l jobgroup=jobexample
|
||||||
do
|
|
||||||
kubectl logs $p
|
|
||||||
done
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|||||||
Reference in New Issue
Block a user