Move Jobs under Controllers. (#3453)
* Move Jobs under Controllers. * Change title.reviewable/pr3454/r1
parent
e90ba44bb8
commit
38395e7b53
|
@ -38,10 +38,8 @@ toc:
|
|||
- docs/concepts/workloads/controllers/petset.md
|
||||
- docs/concepts/workloads/controllers/daemonset.md
|
||||
- docs/concepts/workloads/controllers/garbage-collection.md
|
||||
- title: Jobs
|
||||
section:
|
||||
- docs/concepts/jobs/run-to-completion-finite-workloads.md
|
||||
- docs/concepts/jobs/cron-jobs.md
|
||||
- docs/concepts/workloads/controllers/jobs-run-to-completion.md
|
||||
- docs/concepts/workloads/controllers/cron-jobs.md
|
||||
|
||||
- title: Nodes
|
||||
section:
|
||||
|
|
|
@ -4,6 +4,9 @@ assignees:
|
|||
- soltysh
|
||||
- janetkuo
|
||||
title: Cron Jobs
|
||||
redirect_from:
|
||||
- "/docs/concepts/jobs/cron-jobs/"
|
||||
- "/docs/concepts/jobs/cron-jobs.html"
|
||||
---
|
||||
|
||||
* TOC
|
||||
|
@ -42,7 +45,7 @@ for more). You cannot use Cron Jobs on a hosted Kubernetes provider that has dis
|
|||
Here is an example Cron Job. Every minute, it runs a simple job to print current time and then say
|
||||
hello.
|
||||
|
||||
{% include code.html language="yaml" file="cronjob.yaml" ghlink="/docs/concepts/jobs/cronjob.yaml" %}
|
||||
{% include code.html language="yaml" file="cronjob.yaml" ghlink="/docs/concepts/workloads/controllers/cronjob.yaml" %}
|
||||
|
||||
Run the example cron job by downloading the example file and then running this command:
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: batch/v2alpha1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: hello
|
||||
spec:
|
||||
schedule: "*/1 * * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: hello
|
||||
image: busybox
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- date; echo Hello from the Kubernetes cluster
|
||||
restartPolicy: OnFailure
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: pi
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: pi
|
||||
spec:
|
||||
containers:
|
||||
- name: pi
|
||||
image: perl
|
||||
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
|
||||
restartPolicy: Never
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
assignees:
|
||||
- erictune
|
||||
- soltysh
|
||||
title: Run to Completion Finite Workloads
|
||||
title: Jobs - Run to Completion
|
||||
redirect_from:
|
||||
- "/docs/concepts/jobs/run-to-completion-finite-workloads/"
|
||||
- "/docs/concepts/jobs/run-to-completion-finite-workloads.html"
|
||||
---
|
||||
|
||||
* TOC
|
||||
|
@ -32,7 +35,7 @@ Please use `batch/v1.Job` instead.
|
|||
Here is an example Job config. It computes π to 2000 places and prints it out.
|
||||
It takes around 10s to complete.
|
||||
|
||||
{% include code.html language="yaml" file="job.yaml" ghlink="/docs/user-guide/job.yaml" %}
|
||||
{% include code.html language="yaml" file="job.yaml" ghlink="/docs/concepts/workloads/controllers/job.yaml" %}
|
||||
|
||||
Run the example job by downloading the example file and then running this command:
|
||||
|
Loading…
Reference in New Issue