CronJob represents the configuration of a single cron job.
CronJob represents the configuration of a single cron job.
object
Property | Type | Description |
---|---|---|
|
|
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
|
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
|
|
|
CronJobSpec describes how the job execution will look like and when it will actually run. |
|
|
CronJobStatus represents the current state of a cron job. |
CronJobSpec describes how the job execution will look like and when it will actually run.
object
schedule
jobTemplate
Property | Type | Description |
---|---|---|
|
|
Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn’t finished yet; - "Replace": cancels currently running job and replaces it with a new one Possible enum values:
- |
|
|
The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1. |
|
|
JobTemplateSpec describes the data a Job should have when created from a template |
|
|
The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. |
|
|
Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. |
|
|
The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3. |
|
|
This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. |
|
|
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 |
JobTemplateSpec describes the data a Job should have when created from a template
object
Property | Type | Description |
---|---|---|
|
Standard object’s metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
|
|
|
JobSpec describes how the job execution will look like. |
JobSpec describes how the job execution will look like.
object
template
Property | Type | Description |
---|---|---|
|
|
Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again. |
|
|
Specifies the number of retries before marking this job failed. Defaults to 6 |
|
|
CompletionMode specifies how Pod completions are tracked. It can be
More completion modes can be added in the future. If the Job controller observes a mode that it doesn’t recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job. |
|
|
Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ |
|
|
manualSelector controls generation of pod labels and pod selectors. Leave |
|
|
Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ |
|
A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors |
|
|
|
Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false. |
|
Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ |
|
|
|
ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won’t be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. |
CronJobStatus represents the current state of a cron job.
object
Property | Type | Description |
---|---|---|
|
A list of pointers to currently running jobs. |
|
|
Information when was the last time the job was successfully scheduled. |
|
|
Information when was the last time the job successfully completed. |
The following API endpoints are available:
/apis/batch/v1/cronjobs
GET
: list or watch objects of kind CronJob
/apis/batch/v1/watch/cronjobs
GET
: watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.
/apis/batch/v1/namespaces/{namespace}/cronjobs
DELETE
: delete collection of CronJob
GET
: list or watch objects of kind CronJob
POST
: create a CronJob
/apis/batch/v1/watch/namespaces/{namespace}/cronjobs
GET
: watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.
/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}
DELETE
: delete a CronJob
GET
: read the specified CronJob
PATCH
: partially update the specified CronJob
PUT
: replace the specified CronJob
/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}
GET
: watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.
/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status
GET
: read status of the specified CronJob
PATCH
: partially update status of the specified CronJob
PUT
: replace status of the specified CronJob