Update command outputs to k8s 1.13 based and split command outputs (#13014)
* Update command outputs to k8s 1.13 based and split command outputs * Add comments before commands * fix comments for consistency reason
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
0ceb362beb
commit
49ef5c3486
@@ -42,6 +42,9 @@ Note that the label key `jobgroup` is not special to Kubernetes. You can pick yo
|
|||||||
Next, expand the template into multiple files, one for each item to be processed.
|
Next, expand the template into multiple files, one for each item to be processed.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
# Download job-templ.yaml
|
||||||
|
curl -L -s -O https://k8s.io/examples/application/job/job-tmpl.yaml
|
||||||
|
|
||||||
# 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
|
||||||
@@ -54,6 +57,11 @@ Check if it worked:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
ls jobs/
|
ls jobs/
|
||||||
|
```
|
||||||
|
|
||||||
|
The output is similar to this:
|
||||||
|
|
||||||
|
```
|
||||||
job-apple.yaml
|
job-apple.yaml
|
||||||
job-banana.yaml
|
job-banana.yaml
|
||||||
job-cherry.yaml
|
job-cherry.yaml
|
||||||
@@ -67,19 +75,29 @@ 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-banana" created
|
|
||||||
job "process-item-cherry" created
|
The output is similar to this:
|
||||||
|
|
||||||
|
```
|
||||||
|
job.batch/process-item-apple created
|
||||||
|
job.batch/process-item-banana created
|
||||||
|
job.batch/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
|
```
|
||||||
process-item-apple 1 1 31s
|
|
||||||
process-item-banana 1 1 31s
|
The output is similar to this:
|
||||||
process-item-cherry 1 1 31s
|
|
||||||
|
```
|
||||||
|
NAME COMPLETIONS DURATION AGE
|
||||||
|
process-item-apple 1/1 14s 20s
|
||||||
|
process-item-banana 1/1 12s 20s
|
||||||
|
process-item-cherry 1/1 12s 20s
|
||||||
```
|
```
|
||||||
|
|
||||||
Here we use the `-l` option to select all jobs that are part of this
|
Here we use the `-l` option to select all jobs that are part of this
|
||||||
@@ -90,6 +108,11 @@ 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
|
||||||
|
```
|
||||||
|
|
||||||
|
The output is similar to this:
|
||||||
|
|
||||||
|
```
|
||||||
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
|
||||||
@@ -104,6 +127,11 @@ for p in $(kubectl get pods -l jobgroup=jobexample -o name)
|
|||||||
do
|
do
|
||||||
kubectl logs $p
|
kubectl logs $p
|
||||||
done
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
The output is:
|
||||||
|
|
||||||
|
```
|
||||||
Processing item apple
|
Processing item apple
|
||||||
Processing item banana
|
Processing item banana
|
||||||
Processing item cherry
|
Processing item cherry
|
||||||
|
|||||||
Reference in New Issue
Block a user