Move Jobs under Controllers. (#3453)
* Move Jobs under Controllers. * Change title.
This commit is contained in:
+2
-4
@@ -38,10 +38,8 @@ toc:
|
|||||||
- docs/concepts/workloads/controllers/petset.md
|
- docs/concepts/workloads/controllers/petset.md
|
||||||
- docs/concepts/workloads/controllers/daemonset.md
|
- docs/concepts/workloads/controllers/daemonset.md
|
||||||
- docs/concepts/workloads/controllers/garbage-collection.md
|
- docs/concepts/workloads/controllers/garbage-collection.md
|
||||||
- title: Jobs
|
- docs/concepts/workloads/controllers/jobs-run-to-completion.md
|
||||||
section:
|
- docs/concepts/workloads/controllers/cron-jobs.md
|
||||||
- docs/concepts/jobs/run-to-completion-finite-workloads.md
|
|
||||||
- docs/concepts/jobs/cron-jobs.md
|
|
||||||
|
|
||||||
- title: Nodes
|
- title: Nodes
|
||||||
section:
|
section:
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ assignees:
|
|||||||
- soltysh
|
- soltysh
|
||||||
- janetkuo
|
- janetkuo
|
||||||
title: Cron Jobs
|
title: Cron Jobs
|
||||||
|
redirect_from:
|
||||||
|
- "/docs/concepts/jobs/cron-jobs/"
|
||||||
|
- "/docs/concepts/jobs/cron-jobs.html"
|
||||||
---
|
---
|
||||||
|
|
||||||
* TOC
|
* 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
|
Here is an example Cron Job. Every minute, it runs a simple job to print current time and then say
|
||||||
hello.
|
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:
|
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
|
||||||
|
|
||||||
+5
-2
@@ -2,7 +2,10 @@
|
|||||||
assignees:
|
assignees:
|
||||||
- erictune
|
- erictune
|
||||||
- soltysh
|
- 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
|
* 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.
|
Here is an example Job config. It computes π to 2000 places and prints it out.
|
||||||
It takes around 10s to complete.
|
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:
|
Run the example job by downloading the example file and then running this command:
|
||||||
|
|
||||||
Reference in New Issue
Block a user