Skip to content

Commit

Permalink
Merge pull request #36497 from windsonsea/crjobyhf
Browse files Browse the repository at this point in the history
[zh] Sync1.25 /kubernetes-api/workload-resources/cron-job-v1.md
  • Loading branch information
k8s-ci-robot committed Sep 2, 2022
2 parents c04a7c0 + c59484c commit a4dde75
Showing 1 changed file with 17 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ CronJob 代表单个定时作业(Cron Job) 的配置。

- **apiVersion**: batch/v1


- **kind**: CronJob


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

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

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

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

<!--
- **timeZone** (string)
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.
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.
-->

- **timeZone** (string)

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

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

- **concurrencyPolicy** (string)

指定如何处理作业的并发执行。 有效值为:
指定如何处理作业的并发执行。 有效值为:

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

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

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


## CronJobStatus {#CronJobStatus}

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


## CronJobList {#CronJobList}

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

- **apiVersion**: batch/v1


- **kind**: CronJobList

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

items 是 CronJobs 的列表。

items 是 CronJob 的列表。

<!--
## Operations {#Operations}
-->
## 操作 {#操作}
## 操作 {#Operations}

<hr>

Expand All @@ -292,7 +293,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
#### Parameters
-->

### `get` 查看指定的 CronJob

#### HTTP 请求
Expand All @@ -306,12 +306,10 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
name of the CronJob
- **namespace** (*in path*): string, required
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **pretty** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
Expand All @@ -325,23 +323,20 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

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


- **pretty** (**查询参数**): string

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

<!--
#### Response
-->

#### 响应

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

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

401: Unauthorized
Expand All @@ -354,7 +349,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
#### Parameters
-->

### `get` 查看指定 CronJob 的状态
Expand All @@ -370,12 +364,10 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
name of the CronJob
- **namespace** (*in path*): string, required
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **pretty** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
Expand All @@ -385,28 +377,24 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status

CronJob 的名称


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

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


- **pretty** (**查询参数**): string

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

<!--
#### Response
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
401: Unauthorized
-->

#### 响应


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

401: Unauthorized
Expand All @@ -420,7 +408,6 @@ GET /apis/batch/v1/namespaces/{namespace}/cronjobs
#### Parameters
-->

### `list` 查看或监视 CronJob 类别的对象

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

#### 响应


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

401: Unauthorized
Expand All @@ -563,7 +549,6 @@ GET /apis/batch/v1/cronjobs
#### Parameters
-->

### `list` 查看或监视 CronJob 类型的对象

#### HTTP 请求
Expand Down Expand Up @@ -675,15 +660,13 @@ GET /apis/batch/v1/cronjobs
<!--
#### Response
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJobList" >}}">CronJobList</a>): OK
401: Unauthorized
-->

#### 响应


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

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

#### 参数


<!--
- **namespace** (*in path*): string, required
Expand Down Expand Up @@ -766,7 +748,6 @@ POST /apis/batch/v1/namespaces/{namespace}/cronjobs
<!--
#### Response
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand All @@ -778,7 +759,6 @@ POST /apis/batch/v1/namespaces/{namespace}/cronjobs

#### 响应


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

201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand Down Expand Up @@ -873,7 +853,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
<!--
#### Response
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand All @@ -883,7 +862,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

#### 响应


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

201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand Down Expand Up @@ -977,7 +955,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
<!--
#### Response
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand All @@ -987,7 +964,6 @@ PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status

#### 响应


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

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

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

#### 响应


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

201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand Down Expand Up @@ -1206,7 +1179,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
<!--
#### Response
200 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): OK
201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand All @@ -1216,7 +1188,6 @@ PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status

#### 响应


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

201 (<a href="{{< ref "../workload-resources/cron-job-v1#CronJob" >}}">CronJob</a>): Created
Expand Down Expand Up @@ -1310,7 +1281,6 @@ DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
<!--
#### Response
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): Accepted
Expand All @@ -1320,7 +1290,6 @@ DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

#### 响应


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

202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): Accepted
Expand Down Expand Up @@ -1474,15 +1443,13 @@ DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs
<!--
#### Response
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
401: Unauthorized
-->

#### 响应


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

401: Unauthorized
Expand Down

0 comments on commit a4dde75

Please sign in to comment.