Skip to content

Commit f59314a

Browse files
committed
[en] correction for text consistency and title tags
1 parent 1619d8b commit f59314a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,16 @@ Therefore, jobs should be idempotent.
2626
For more limitations, see [CronJobs](/docs/concepts/workloads/controllers/cron-jobs).
2727

2828

29-
3029
## {{% heading "prerequisites" %}}
3130

32-
3331
* {{< include "task-tutorial-prereqs.md" >}}
3432

35-
36-
3733
<!-- steps -->
3834

39-
## Creating a Cron Job
35+
## Creating a CronJob {#creating-a-cron-job}
4036

4137
Cron jobs require a config file.
42-
This example cron job config `.spec` file prints the current time and a hello message every minute:
38+
Here is a manifest for a CronJob that runs a simple demonstration task every minute:
4339

4440
{{< codenew file="application/job/cronjob.yaml" >}}
4541

@@ -59,6 +55,7 @@ After creating the cron job, get its status using this command:
5955
```shell
6056
kubectl get cronjob hello
6157
```
58+
6259
The output is similar to this:
6360

6461
```
@@ -87,6 +84,7 @@ You can stop watching the job and view the cron job again to see that it schedul
8784
```shell
8885
kubectl get cronjob hello
8986
```
87+
9088
The output is similar to this:
9189

9290
```
@@ -99,14 +97,14 @@ You should see that the cron job `hello` successfully scheduled a job at the tim
9997
Now, find the pods that the last scheduled job created and view the standard output of one of the pods.
10098

10199
{{< note >}}
102-
The job name and pod name are different.
100+
The job name is different from the pod name.
103101
{{< /note >}}
104102

105103
```shell
106104
# Replace "hello-4111706356" with the job name in your system
107105
pods=$(kubectl get pods --selector=job-name=hello-4111706356 --output=jsonpath={.items[*].metadata.name})
108106
```
109-
Show pod log:
107+
Show the pod log:
110108

111109
```shell
112110
kubectl logs $pods
@@ -118,7 +116,7 @@ Fri Feb 22 11:02:09 UTC 2019
118116
Hello from the Kubernetes cluster
119117
```
120118

121-
## Deleting a Cron Job
119+
## Deleting a CronJob {#deleting-a-cron-job}
122120

123121
When you don't need a cron job any more, delete it with `kubectl delete cronjob <cronjob name>`:
124122

@@ -129,16 +127,20 @@ kubectl delete cronjob hello
129127
Deleting the cron job removes all the jobs and pods it created and stops it from creating additional jobs.
130128
You can read more about removing jobs in [garbage collection](/docs/concepts/workloads/controllers/garbage-collection/).
131129

132-
## Writing a Cron Job Spec
130+
## Writing a CronJob Spec {#writing-a-cron-job-spec}
133131

134-
As with all other Kubernetes configs, a cron job needs `apiVersion`, `kind`, and `metadata` fields. For general
135-
information about working with config files, see [deploying applications](/docs/tasks/run-application/run-stateless-application-deployment/),
132+
As with all other Kubernetes objects, a CronJob must have `apiVersion`, `kind`, and `metadata` fields.
133+
For more information about working with Kubernetes objects and their
134+
{{< glossary_tooltip text="manifests" term_id="manifest" >}}, see the
135+
[managing resources](/docs/concepts/cluster-administration/manage-deployment/),
136136
and [using kubectl to manage resources](/docs/concepts/overview/working-with-objects/object-management/) documents.
137137

138-
A cron job config also needs a [`.spec` section](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status).
138+
Each manifest for a CrobJob also needs a [`.spec`](/docs/concepts/overview/working-with-objects/kubernetes-objects/#object-spec-and-status) section.
139139

140140
{{< note >}}
141-
All modifications to a cron job, especially its `.spec`, are applied only to the following runs.
141+
If you modify a CronJob, the changes you make apply to new Jobs that start after your modification
142+
is complete. Jobs (and their Pods) that have already started continue to run without changes:
143+
the CronJob does _not_ update existing Jobs, even if those remain running.
142144
{{< /note >}}
143145

144146
### Schedule
@@ -149,11 +151,11 @@ It takes a [Cron](https://en.wikipedia.org/wiki/Cron) format string, such as `0
149151
The format also includes extended "Vixie cron" step values. As explained in the
150152
[FreeBSD manual](https://www.freebsd.org/cgi/man.cgi?crontab%285%29):
151153

152-
> Step values can be used in conjunction with ranges. Following a range
153-
> with `/<number>` specifies skips of the number's value through the
154-
> range. For example, `0-23/2` can be used in the hours field to specify
155-
> command execution every other hour (the alternative in the V7 standard is
156-
> `0,2,4,6,8,10,12,14,16,18,20,22`). Steps are also permitted after an
154+
> Step values can be used in conjunction with ranges. Following a range
155+
> with `/<number>` specifies skips of the number's value through the
156+
> range. For example, `0-23/2` can be used in the hours field to specify
157+
> command execution every other hour (the alternative in the V7 standard is
158+
> `0,2,4,6,8,10,12,14,16,18,20,22`). Steps are also permitted after an
157159
> asterisk, so if you want to say "every two hours", just use `*/2`.
158160
159161
{{< note >}}
@@ -211,5 +213,3 @@ When `.spec.suspend` changes from `true` to `false` on an existing cron job with
211213
The `.spec.successfulJobsHistoryLimit` and `.spec.failedJobsHistoryLimit` fields are optional.
212214
These fields specify how many completed and failed jobs should be kept.
213215
By default, they are set to 3 and 1 respectively. Setting a limit to `0` corresponds to keeping none of the corresponding kind of jobs after they finish.
214-
215-

0 commit comments

Comments
 (0)