Skip to content

Commit

Permalink
Update the parallel-processing-expansion.md task file and remove $ (k…
Browse files Browse the repository at this point in the history
  • Loading branch information
DanyC97 authored and yagonobre committed Mar 14, 2019
1 parent 45395a2 commit 97ff27d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions content/en/docs/tasks/job/parallel-processing-expansion.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Next, expand the template into multiple files, one for each item to be processed

```shell
# Expand files into a temporary directory
$ mkdir ./jobs
$ for i in apple banana cherry
mkdir ./jobs
for i in apple banana cherry
do
cat job-tmpl.yaml | sed "s/\$ITEM/$i/" > ./jobs/job-$i.yaml
done
Expand All @@ -53,7 +53,7 @@ done
Check if it worked:

```shell
$ ls jobs/
ls jobs/
job-apple.yaml
job-banana.yaml
job-cherry.yaml
Expand All @@ -66,7 +66,7 @@ to generate the Job objects.
Next, create all the jobs with one kubectl command:

```shell
$ kubectl create -f ./jobs
kubectl create -f ./jobs
job "process-item-apple" created
job "process-item-banana" created
job "process-item-cherry" created
Expand All @@ -75,7 +75,7 @@ job "process-item-cherry" created
Now, check on the jobs:

```shell
$ kubectl get jobs -l jobgroup=jobexample
kubectl get jobs -l jobgroup=jobexample
NAME DESIRED SUCCESSFUL AGE
process-item-apple 1 1 31s
process-item-banana 1 1 31s
Expand All @@ -89,7 +89,7 @@ do not care to see.)
We can check on the pods as well using the same label selector:

```shell
$ kubectl get pods -l jobgroup=jobexample
kubectl get pods -l jobgroup=jobexample
NAME READY STATUS RESTARTS AGE
process-item-apple-kixwv 0/1 Completed 0 4m
process-item-banana-wrsf7 0/1 Completed 0 4m
Expand All @@ -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:

```shell
$ for p in $(kubectl get pods -l jobgroup=jobexample -o name)
for p in $(kubectl get pods -l jobgroup=jobexample -o name)
do
kubectl logs $p
done
Expand Down

0 comments on commit 97ff27d

Please sign in to comment.