CronJob [page]deterministic
CronJob represents the configuration of a single cron job.
`apiVersion: batch/v1`
`import "k8s.io/api/batch/v1"`
## CronJob {#CronJob}
CronJob represents the configuration of a single cron job.
<hr>
<table> <thead><tr><th>Field</th><th>Description</th></tr></thead> <tbody> <tr> <td><code>apiVersion</code><br/><em>string</em></td> <td>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</td> </tr> <tr> <td><code>kind</code><br/><em>string</em></td> <td>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</td> </tr> <tr> <td><code>metadata</code><br/><em><a href="">ObjectMeta</a></em></td> <td>Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata</td> </tr> <tr> <td><code>spec</code> <strong>*</strong><br/><em><a href="">CronJobSpec</a></em></td> <td>Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status</td> </tr> <tr> <td><code>status</code><br/><em><a href="">CronJobStatus</a></em></td> <td>Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status</td> </tr> </tbody> </table>
## CronJobSpec {#CronJobSpec}
CronJobSpec describes how the job execution will look like and when it will actually run.
<hr>
<table> <thead><tr><th>Field</th><th>Description</th></tr></thead> <tbody> <tr> <td><code>concurrencyPolicy</code><br/><em>string</em></td> <td>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<br/><br/>Possible enum values:<br/> - `"Allow"` allows CronJobs to run concurrently.<br/> - `"Forbid"` forbids concurrent runs, skipping next run if previous hasn't finished yet.<br/> - `"Replace"` cancels currently running job and replaces it with a new one.</td> </tr> <tr> <td><code>failedJobsHistoryLimit</code><br/><em>integer</em></td> <td>The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.</td> </tr> <tr> <td><code>jobTemplate</code> <strong>*</strong><br/><em><a href="">JobTemplateSpec</a></em></td> <td>Specifies the job that will be created when executing a CronJob.</td> </tr> <tr> <td><code>schedule</code> <strong>*</strong><br/><em>string</em></td> <td>The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.</td> </tr> <tr> <td><code>startingDeadlineSeconds</code><br/><em>integer</em></td> <td>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.</td> </tr> <tr> <td><code>successfulJobsHistoryLimit</code><br/><em>integer</em></td> <td>The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.</td> </tr> <tr> <td><code>suspend</code><br/><em>boolean</em></td> <td>This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.</td> </tr> <tr> <td><code> …(trimmed)