Skip to content

Commit 9beadba

Browse files
authored
Merge pull request #32154 from 0xff-dev/main
[zh] update automated-tasks-with-cron-jobs doc
2 parents 9017f40 + bd5299b commit 9beadba

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Cron jobs can also schedule individual tasks for a specific time, such as if you
3030
-->
3131

3232
在Kubernetes v1.21 版本中,CronJob 被提升为通用版本。如果你使用的是旧版本的 Kubernetes,请参考你正在使用的 Kubernetes 版本的文档,这样你就能看到准确的信息。旧的 Kubernetes 版本不支持`batch/v1` CronJob API。
33+
3334
你可以利用 [CronJobs](/zh/docs/concepts/workloads/controllers/cron-jobs) 执行基于时间调度的任务。这些自动化任务和 Linux 或者 Unix 系统的 [Cron](https://en.wikipedia.org/wiki/Cron) 任务类似。
3435

3536
CronJobs 在创建周期性以及重复性的任务时很有帮助,例如执行备份操作或者发送邮件。CronJobs 也可以在特定时间调度单个任务,例如你想调度低活跃周期的任务。
@@ -43,6 +44,7 @@ For more limitations, see [CronJobs](/docs/concepts/workloads/controllers/cron-j
4344
CronJobs 有一些限制和特点。
4445
例如,在特定状况下,同一个 CronJob 可以创建多个任务。
4546
因此,任务应该是幂等的。
47+
4648
查看更多限制,请参考 [CronJobs](/zh/docs/concepts/workloads/controllers/cron-jobs)
4749

4850
## {{% heading "prerequisites" %}}
@@ -134,16 +136,14 @@ hello */1 * * * * False 0 50s 75s
134136
```
135137

136138
<!--
137-
You should see that the cron job "hello" successfully scheduled a job at the time specified in `LAST-SCHEDULE`.
138-
There are currently 0 active jobs, meaning that the job has completed or failed.
139+
You should see that the cron job `hello` successfully scheduled a job at the time specified in `LAST SCHEDULE`. There are currently 0 active jobs, meaning that the job has completed or failed.
139140
140141
Now, find the pods that the last scheduled job created and view the standard output of one of the pods.
141-
Note that the job name and pod name are different.
142142
-->
143-
你应该能看到 hello CronJob 在 `LAST-SCHEDULE` 声明的时间点成功的调度了一次任务。
143+
你应该能看到 `hello` CronJob 在 `LAST SCHEDULE` 声明的时间点成功的调度了一次任务。
144144
有 0 个活跃的任务意味着任务执行完毕或者执行失败。
145145

146-
现在,找到最后一次调度任务创建的 Pod 并查看一个 Pod 的标准输出。请注意任务名称和 Pod 名称是不同的。
146+
现在,找到最后一次调度任务创建的 Pod 并查看一个 Pod 的标准输出。
147147

148148
<!--
149149
The job name and pod name are different.
@@ -165,6 +165,10 @@ Show pod log:
165165
```shell
166166
kubectl logs $pods
167167
```
168+
<!--
169+
The output is similar to this:
170+
-->
171+
输出与此类似:
168172

169173
```
170174
Fri Feb 22 11:02:09 UTC 2019
@@ -359,6 +363,6 @@ By default, they are set to 3 and 1 respectively. Setting a limit to `0` corres
359363

360364
`.spec.successfulJobsHistoryLimit``.spec.failedJobsHistoryLimit`是可选的。
361365
这两个字段指定应保留多少已完成和失败的任务。
362-
默认设置为3和1。限制设置为0代表相应类型的任务完成后不会保留
366+
默认设置为3和1。限制设置为 `0` 代表相应类型的任务完成后不会保留
363367

364368

0 commit comments

Comments
 (0)