CronJob
apiVersion: batch/v1
import "k8s.io/api/batch/v1"
CronJob
CronJob 代表单个 cron 作业的配置。
apiVersion: batch/v1
kind: CronJob
metadata (ObjectMeta)
标准对象的元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (CronJobSpec)
cron 作业所需行为的规范,包括调度。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (CronJobStatus)
cron 作业的当前状态。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
CronJobSpec
CronJobSpec 描述了作业执行的样式以及实际运行时间。
jobTemplate (JobTemplateSpec), required
指定在执行 CronJob 时将创建的作业。
JobTemplateSpec 描述了从模板创建作业时作业应具有的数据
jobTemplate.metadata (ObjectMeta)
从该模板创建的作业的标准对象元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
jobTemplate.spec (JobSpec)
作业所需行为的规范。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
schedule (string), required
Cron 格式的调度,参见 https://en.wikipedia.org/wiki/Cron。
timeZone (string)
给定调度的时区名称,参见 https://en.wikipedia.org/wiki/List_of_tz_database_time_zones。如果未指定,则默认为 kube-controller-manager 进程的时区。有效时区名称集和时区偏移量在 CronJob 验证期间由 API 服务器从系统范围的时区数据库加载,并在执行期间由控制器管理器加载。如果找不到系统范围的时区数据库,则使用捆绑版本的数据库。如果时区名称在 CronJob 的生命周期内或由于主机配置更改而变得无效,则控制器将停止创建新的作业,并将创建一个带有原因 UnknownTimeZone 的系统事件。更多信息可以在 https://kubernetes.ac.cn/docs/concepts/workloads/controllers/cron-jobs/#time-zones 中找到
concurrencyPolicy (string)
指定如何处理作业的并发执行。有效值为
- "Allow" (默认):允许 CronJobs 并发运行; - "Forbid":禁止并发运行,如果前一次运行尚未完成,则跳过下一次运行; - "Replace":取消当前正在运行的作业并用新的作业替换它
startingDeadlineSeconds (int64)
如果由于任何原因错过了计划时间,则启动作业的可选截止时间(以秒为单位)。错过的作业执行将被计为失败的执行。
suspend (boolean)
此标志告诉控制器暂停后续执行,它不适用于已启动的执行。默认为 false。
successfulJobsHistoryLimit (int32)
要保留的成功完成作业的数量。值必须是非负整数。默认为 3。
failedJobsHistoryLimit (int32)
要保留的失败完成作业的数量。值必须是非负整数。默认为 1。
CronJobStatus
CronJobStatus 表示 cron 作业的当前状态。
active ([]ObjectReference)
原子:在合并期间将被替换
指向当前正在运行的作业的指针列表。
lastScheduleTime (Time)
作业上次成功调度的时间信息。
Time 是 time.Time 的包装器,它支持正确地编组到 YAML 和 JSON。为 time 包提供的许多工厂方法提供了包装器。
lastSuccessfulTime (Time)
作业上次成功完成的时间信息。
Time 是 time.Time 的包装器,它支持正确地编组到 YAML 和 JSON。为 time 包提供的许多工厂方法提供了包装器。
CronJobList
CronJobList 是 cron 作业的集合。
apiVersion: batch/v1
kind: CronJobList
metadata (ListMeta)
标准列表元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]CronJob), required
items 是 CronJobs 的列表。
操作
get
读取指定的 CronJob
HTTP 请求
GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
pretty (在查询中): string
响应
200 (CronJob): OK
401: 未经授权
get
读取指定 CronJob 的状态
HTTP 请求
GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
pretty (在查询中): string
响应
200 (CronJob): OK
401: 未经授权
list
列出或监视 CronJob 类型的对象
HTTP 请求
GET /apis/batch/v1/namespaces/{namespace}/cronjobs
参数
namespace (在路径中): string, required
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (CronJobList): OK
401: 未经授权
list
列出或监视 CronJob 类型的对象
HTTP 请求
GET /apis/batch/v1/cronjobs
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (CronJobList): OK
401: 未经授权
create
创建一个 CronJob
HTTP 请求
POST /apis/batch/v1/namespaces/{namespace}/cronjobs
参数
namespace (在路径中): string, required
body: CronJob, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CronJob): OK
201 (CronJob): 已创建
202 (CronJob): 已接受
401: 未经授权
update
替换指定的 CronJob
HTTP 请求
PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
body: CronJob, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CronJob): OK
201 (CronJob): 已创建
401: 未经授权
update
替换指定 CronJob 的状态
HTTP 请求
PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
body: CronJob, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CronJob): OK
201 (CronJob): 已创建
401: 未经授权
patch
部分更新指定的 CronJob
HTTP 请求
PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
body: Patch, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (CronJob): OK
201 (CronJob): 已创建
401: 未经授权
patch
部分更新指定 CronJob 的状态
HTTP 请求
PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
body: Patch, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (CronJob): OK
201 (CronJob): 已创建
401: 未经授权
delete
删除一个 CronJob
HTTP 请求
DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
参数
name (在路径中): string, required
CronJob 的名称
namespace (在路径中): string, required
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未经授权
deletecollection
删除 CronJob 的集合
HTTP 请求
DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs
参数
namespace (在路径中): string, required
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): integer
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): OK
401: 未经授权
此页面是自动生成的。
如果您打算报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。