Update the parallel-processing-expansion.md task file and remove $ (#12794)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
3999608ca6
commit
2f6bee10ca
@@ -43,8 +43,8 @@ Next, expand the template into multiple files, one for each item to be processed
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Expand files into a temporary directory
|
# Expand files into a temporary directory
|
||||||
$ mkdir ./jobs
|
mkdir ./jobs
|
||||||
$ for i in apple banana cherry
|
for i in apple banana cherry
|
||||||
do
|
do
|
||||||
cat job-tmpl.yaml | sed "s/\$ITEM/$i/" > ./jobs/job-$i.yaml
|
cat job-tmpl.yaml | sed "s/\$ITEM/$i/" > ./jobs/job-$i.yaml
|
||||||
done
|
done
|
||||||
@@ -53,7 +53,7 @@ done
|
|||||||
Check if it worked:
|
Check if it worked:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ ls jobs/
|
ls jobs/
|
||||||
job-apple.yaml
|
job-apple.yaml
|
||||||
job-banana.yaml
|
job-banana.yaml
|
||||||
job-cherry.yaml
|
job-cherry.yaml
|
||||||
@@ -66,7 +66,7 @@ to generate the Job objects.
|
|||||||
Next, create all the jobs with one kubectl command:
|
Next, create all the jobs with one kubectl command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ kubectl create -f ./jobs
|
kubectl create -f ./jobs
|
||||||
job "process-item-apple" created
|
job "process-item-apple" created
|
||||||
job "process-item-banana" created
|
job "process-item-banana" created
|
||||||
job "process-item-cherry" created
|
job "process-item-cherry" created
|
||||||
@@ -75,7 +75,7 @@ job "process-item-cherry" created
|
|||||||
Now, check on the jobs:
|
Now, check on the jobs:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ kubectl get jobs -l jobgroup=jobexample
|
kubectl get jobs -l jobgroup=jobexample
|
||||||
NAME DESIRED SUCCESSFUL AGE
|
NAME DESIRED SUCCESSFUL AGE
|
||||||
process-item-apple 1 1 31s
|
process-item-apple 1 1 31s
|
||||||
process-item-banana 1 1 31s
|
process-item-banana 1 1 31s
|
||||||
@@ -89,7 +89,7 @@ do not care to see.)
|
|||||||
We can check on the pods as well using the same label selector:
|
We can check on the pods as well using the same label selector:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ kubectl get pods -l jobgroup=jobexample
|
kubectl get pods -l jobgroup=jobexample
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
process-item-apple-kixwv 0/1 Completed 0 4m
|
process-item-apple-kixwv 0/1 Completed 0 4m
|
||||||
process-item-banana-wrsf7 0/1 Completed 0 4m
|
process-item-banana-wrsf7 0/1 Completed 0 4m
|
||||||
@@ -100,7 +100,7 @@ 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:
|
but looping over all the pods is pretty easy:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ for p in $(kubectl get pods -l jobgroup=jobexample -o name)
|
for p in $(kubectl get pods -l jobgroup=jobexample -o name)
|
||||||
do
|
do
|
||||||
kubectl logs $p
|
kubectl logs $p
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user