From 2f6bee10cae44d5f5438648f235bc365057bad93 Mon Sep 17 00:00:00 2001 From: Dani Comnea Date: Thu, 28 Feb 2019 05:07:48 +0000 Subject: [PATCH] Update the parallel-processing-expansion.md task file and remove $ (#12794) --- .../tasks/job/parallel-processing-expansion.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/en/docs/tasks/job/parallel-processing-expansion.md b/content/en/docs/tasks/job/parallel-processing-expansion.md index b71f1c7c2e6f8..9a20fccc308cf 100644 --- a/content/en/docs/tasks/job/parallel-processing-expansion.md +++ b/content/en/docs/tasks/job/parallel-processing-expansion.md @@ -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 @@ -53,7 +53,7 @@ done Check if it worked: ```shell -$ ls jobs/ +ls jobs/ job-apple.yaml job-banana.yaml job-cherry.yaml @@ -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 @@ -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 @@ -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 @@ -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