Add content in job.md

* Add description to make it easy to read.

* Distinguish between 'command'and 'output'.

* Add the code blocks to the Markdown spec.
pull/25824/head
Ader 2020-12-27 12:45:46 +08:00 committed by ydFu
parent 8279881e39
commit aa571fbf8d
1 changed files with 7 additions and 3 deletions

View File

@ -38,6 +38,7 @@ You can run the example with this command:
```shell ```shell
kubectl apply -f https://kubernetes.io/examples/controllers/job.yaml kubectl apply -f https://kubernetes.io/examples/controllers/job.yaml
``` ```
The output is similar to this:
``` ```
job.batch/pi created job.batch/pi created
``` ```
@ -47,6 +48,7 @@ Check on the status of the Job with `kubectl`:
```shell ```shell
kubectl describe jobs/pi kubectl describe jobs/pi
``` ```
The output is similar to this:
``` ```
Name: pi Name: pi
Namespace: default Namespace: default
@ -91,6 +93,7 @@ To list all the Pods that belong to a Job in a machine readable form, you can us
pods=$(kubectl get pods --selector=job-name=pi --output=jsonpath='{.items[*].metadata.name}') pods=$(kubectl get pods --selector=job-name=pi --output=jsonpath='{.items[*].metadata.name}')
echo $pods echo $pods
``` ```
The output is similar to this:
``` ```
pi-5rwd7 pi-5rwd7
``` ```
@ -398,10 +401,11 @@ Therefore, you delete Job `old` but _leave its pods
running_, using `kubectl delete jobs/old --cascade=false`. running_, using `kubectl delete jobs/old --cascade=false`.
Before deleting it, you make a note of what selector it uses: Before deleting it, you make a note of what selector it uses:
``` ```shell
kubectl get job old -o yaml kubectl get job old -o yaml
``` ```
``` The output is similar to this:
```yaml
kind: Job kind: Job
metadata: metadata:
name: old name: old
@ -420,7 +424,7 @@ they are controlled by Job `new` as well.
You need to specify `manualSelector: true` in the new Job since you are not using You need to specify `manualSelector: true` in the new Job since you are not using
the selector that the system normally generates for you automatically. the selector that the system normally generates for you automatically.
``` ```yaml
kind: Job kind: Job
metadata: metadata:
name: new name: new