Skip to content

Commit a4dde75

Browse files
authored
Merge pull request #36497 from windsonsea/crjobyhf
[zh] Sync1.25 /kubernetes-api/workload-resources/cron-job-v1.md
2 parents c04a7c0 + c59484c commit a4dde75

File tree

1 file changed

+17
-50
lines changed
  • content/zh-cn/docs/reference/kubernetes-api/workload-resources

1 file changed

+17
-50
lines changed

content/zh-cn/docs/reference/kubernetes-api/workload-resources/cron-job-v1.md

Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ CronJob 代表单个定时作业(Cron Job) 的配置。
3636

3737
- **apiVersion**: batch/v1
3838

39-
4039
- **kind**: CronJob
4140

42-
4341
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
4442

4543
<!--
@@ -117,18 +115,25 @@ CronJobSpec 描述了作业的执行方式和实际将运行的时间。
117115

118116
- **schedule** (string), 必需
119117

120-
Cron 格式的排期表,请参阅 https://en.wikipedia.org/wiki/Cron.
118+
Cron 格式的排期表,请参阅 https://zh.wikipedia.org/wiki/Cron
121119

122120
<!--
123121
- **timeZone** (string)
124122
125-
The time zone for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will rely on the time zone of the kube-controller-manager process. ALPHA: This field is in alpha and must be enabled via the `CronJobTimeZone` feature gate.
123+
The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones This is beta field and must be enabled via the `CronJobTimeZone` feature gate.
126124
-->
127125

128126
- **timeZone** (string)
129127

130-
给定时间表的时区,请参阅 https://en.wikipedia.org/wiki/List_of_tz_database_time_zones。
131-
如果未指定,这将取决于 kube-controller-manager 进程的时区。 ALPHA:此字段处于 alpha 状态,必须通过 "CronJobTimeZone" 功能门启用。
128+
给定时间表的时区名称,请参阅 https://en.wikipedia.org/wiki/List_of_tz_database_time_zones。
129+
如果未指定,这将默认为 kube-controller-manager 进程的时区。
130+
有效时区名称和时区偏移量的设置由 API 服务器在 CronJob 验证期间从系统范围的时区数据库进行加载,
131+
在执行期间由控制器管理器从系统范围的时区数据库进行加载。
132+
如果找不到系统范围的时区数据库,则转而使用该数据库的捆绑版本。
133+
如果时区名称在 CronJob 的生命周期内或由于主机配置更改而变得无效,该控制器将停止创建新的 Job,
134+
并将创建一个原因为 UnknownTimeZone 的系统事件。更多信息,请请参阅
135+
https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/cron-jobs/#time-zones。
136+
这是 Beta 字段,必须通过 `CronJobTimeZone` 特性门控启用。
132137

133138
<!--
134139
- **concurrencyPolicy** (string)
@@ -138,11 +143,11 @@ CronJobSpec 描述了作业的执行方式和实际将运行的时间。
138143

139144
- **concurrencyPolicy** (string)
140145

141-
指定如何处理作业的并发执行。 有效值为:
146+
指定如何处理作业的并发执行。 有效值为:
142147

143-
- "Allow" (默认):允许 CronJobs 并发运行;
144-
- "Forbid":禁止并发运行,如果上一次运行尚未完成则跳过下一次运行;
145-
- "Replace":取消当前正在运行的作业并将其替换为新作业
148+
- "Allow" (默认):允许 CronJobs 并发运行;
149+
- "Forbid":禁止并发运行,如果上一次运行尚未完成则跳过下一次运行;
150+
- "Replace":取消当前正在运行的作业并将其替换为新作业
146151

147152
<!--
148153
- **startingDeadlineSeconds** (int64)
@@ -184,7 +189,6 @@ CronJobSpec 描述了作业的执行方式和实际将运行的时间。
184189

185190
要保留的以失败状态结束的作业个数。值必须是非负整数。默认值为 1。
186191

187-
188192
## CronJobStatus {#CronJobStatus}
189193

190194
<!--
@@ -240,7 +244,6 @@ CronJobStatus 表示某个定时作业的当前状态。
240244
<a name="Time"></a>
241245
**Time 是对 time.Time 的封装,它支持对 YAML 和 JSON 的正确编排。为 time 包提供的许多工厂方法模式提供了包装器。**
242246

243-
244247
## CronJobList {#CronJobList}
245248

246249
<!--
@@ -254,7 +257,6 @@ CronJobList 是定时作业的集合。
254257

255258
- **apiVersion**: batch/v1
256259

257-
258260
- **kind**: CronJobList
259261

260262
<!--
@@ -273,13 +275,12 @@ CronJobList 是定时作业的集合。
273275
-->
274276
- **items** ([]<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>), required
275277

276-
items 是 CronJobs 的列表。
277-
278+
items 是 CronJob 的列表。
278279

279280
<!--
280281
## Operations {#Operations}
281282
-->
282-
## 操作 {#操作}
283+
## 操作 {#Operations}
283284

284285
<hr>
285286

@@ -292,7 +293,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
292293
293294
#### Parameters
294295
-->
295-
296296
### `get` 查看指定的 CronJob
297297

298298
#### HTTP 请求
@@ -306,12 +306,10 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
306306
307307
name of the CronJob
308308
309-
310309
- **namespace** (*in path*): string, required
311310
312311
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
313312
314-
315313
- **pretty** (*in query*): string
316314
317315
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
@@ -325,23 +323,20 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
325323

326324
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
327325

328-
329326
- **pretty** (**查询参数**): string
330327

331328
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
332329

333330
<!--
334331
#### Response
335332
-->
336-
337333
#### 响应
338334

339335
<!--
340336
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
341337
342338
401: Unauthorized
343339
-->
344-
345340
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
346341

347342
401: Unauthorized
@@ -354,7 +349,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
354349
GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
355350
356351
#### Parameters
357-
358352
-->
359353

360354
### `get` 查看指定 CronJob 的状态
@@ -370,12 +364,10 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
370364
371365
name of the CronJob
372366
373-
374367
- **namespace** (*in path*): string, required
375368
376369
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
377370
378-
379371
- **pretty** (*in query*): string
380372
381373
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
@@ -385,28 +377,24 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
385377

386378
CronJob 的名称
387379

388-
389380
- **namespace** (**路径参数**): string, 必需
390381

391382
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
392383

393-
394384
- **pretty** (**查询参数**): string
395385

396386
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
397387

398388
<!--
399389
#### Response
400390
401-
402391
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
403392
404393
401: Unauthorized
405394
-->
406395

407396
#### 响应
408397

409-
410398
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
411399

412400
401: Unauthorized
@@ -420,7 +408,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs
420408
421409
#### Parameters
422410
-->
423-
424411
### `list` 查看或监视 CronJob 类别的对象
425412

426413
#### HTTP 请求
@@ -549,7 +536,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs
549536

550537
#### 响应
551538

552-
553539
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJobList" >}}">CronJobList</a>): OK
554540

555541
401: Unauthorized
@@ -563,7 +549,6 @@ GET /apis/batch/v1/cronjobs
563549
564550
#### Parameters
565551
-->
566-
567552
### `list` 查看或监视 CronJob 类型的对象
568553

569554
#### HTTP 请求
@@ -675,15 +660,13 @@ GET /apis/batch/v1/cronjobs
675660
<!--
676661
#### Response
677662
678-
679663
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJobList" >}}">CronJobList</a>): OK
680664
681665
401: Unauthorized
682666
-->
683667

684668
#### 响应
685669

686-
687670
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJobList" >}}">CronJobList</a>): OK
688671

689672
401: Unauthorized
@@ -706,7 +689,6 @@ POST /apis/batch/v1/namespaces/{namespace}/cronjobs
706689

707690
#### 参数
708691

709-
710692
<!--
711693
- **namespace** (*in path*): string, required
712694
@@ -766,7 +748,6 @@ POST /apis/batch/v1/namespaces/{namespace}/cronjobs
766748
<!--
767749
#### Response
768750
769-
770751
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
771752
772753
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -778,7 +759,6 @@ POST /apis/batch/v1/namespaces/{namespace}/cronjobs
778759

779760
#### 响应
780761

781-
782762
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
783763

784764
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -873,7 +853,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
873853
<!--
874854
#### Response
875855
876-
877856
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
878857
879858
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -883,7 +862,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
883862

884863
#### 响应
885864

886-
887865
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
888866

889867
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -977,7 +955,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
977955
<!--
978956
#### Response
979957
980-
981958
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
982959
983960
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -987,7 +964,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
987964

988965
#### 响应
989966

990-
991967
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
992968

993969
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -1016,7 +992,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
1016992
- **name** (*in path*): string, required
1017993
1018994
name of the CronJob
1019-
-
1020995
-->
1021996

1022997
- **name** (**路径参数**): string, 必需
@@ -1092,7 +1067,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
10921067
<!--
10931068
#### Response
10941069
1095-
10961070
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
10971071
10981072
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -1102,7 +1076,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
11021076

11031077
#### 响应
11041078

1105-
11061079
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
11071080

11081081
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -1206,7 +1179,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
12061179
<!--
12071180
#### Response
12081181
1209-
12101182
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
12111183
12121184
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -1216,7 +1188,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
12161188

12171189
#### 响应
12181190

1219-
12201191
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
12211192

12221193
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
@@ -1310,7 +1281,6 @@ DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
13101281
<!--
13111282
#### Response
13121283
1313-
13141284
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
13151285
13161286
202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): Accepted
@@ -1320,7 +1290,6 @@ DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
13201290

13211291
#### 响应
13221292

1323-
13241293
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
13251294

13261295
202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): Accepted
@@ -1474,15 +1443,13 @@ DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs
14741443
<!--
14751444
#### Response
14761445
1477-
14781446
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
14791447
14801448
401: Unauthorized
14811449
-->
14821450

14831451
#### 响应
14841452

1485-
14861453
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
14871454

14881455
401: Unauthorized

0 commit comments

Comments
 (0)