Interface CronJobProps
-
- All Superinterfaces:
AbstractPodProps
,JobProps
,software.amazon.jsii.JsiiSerializable
,ResourceProps
,WorkloadProps
- All Known Implementing Classes:
CronJobProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-02-04T02:31:04.808Z") @Stability(Stable) public interface CronJobProps extends software.amazon.jsii.JsiiSerializable, JobProps
Properties for `CronJob`.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
CronJobProps.Builder
A builder forCronJobProps
static class
CronJobProps.Jsii$Proxy
An implementation forCronJobProps
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static CronJobProps.Builder
builder()
default ConcurrencyPolicy
getConcurrencyPolicy()
Specifies the concurrency policy for the job.default Number
getFailedJobsRetained()
Specifies the number of failed jobs history retained.org.cdk8s.Cron
getSchedule()
Specifies the time in which the job would run again.default org.cdk8s.Duration
getStartingDeadline()
Kubernetes attempts to start cron jobs at its schedule time, but this is not guaranteed.default Number
getSuccessfulJobsRetained()
Specifies the number of successful jobs history retained.default Boolean
getSuspend()
Specifies if the cron job should be suspended.default String
getTimeZone()
Specifies the timezone for the job.-
Methods inherited from interface org.cdk8s.plus24.AbstractPodProps
getAutomountServiceAccountToken, getContainers, getDns, getDockerRegistryAuth, getHostAliases, getInitContainers, getIsolate, getRestartPolicy, getSecurityContext, getServiceAccount, getVolumes
-
Methods inherited from interface org.cdk8s.plus24.JobProps
getActiveDeadline, getBackoffLimit, getTtlAfterFinished
-
Methods inherited from interface org.cdk8s.plus24.ResourceProps
getMetadata
-
Methods inherited from interface org.cdk8s.plus24.WorkloadProps
getPodMetadata, getSelect, getSpread
-
-
-
-
Method Detail
-
getSchedule
@Stability(Stable) @NotNull org.cdk8s.Cron getSchedule()
Specifies the time in which the job would run again.This is defined as a cron expression in the CronJob resource.
-
getConcurrencyPolicy
@Stability(Stable) @Nullable default ConcurrencyPolicy getConcurrencyPolicy()
Specifies the concurrency policy for the job.Default: ConcurrencyPolicy.Forbid
-
getFailedJobsRetained
@Stability(Stable) @Nullable default Number getFailedJobsRetained()
Specifies the number of failed jobs history retained.This would retain the Job and the associated Pod resource and can be useful for debugging.
Default: 1
-
getStartingDeadline
@Stability(Stable) @Nullable default org.cdk8s.Duration getStartingDeadline()
Kubernetes attempts to start cron jobs at its schedule time, but this is not guaranteed.This deadline specifies how much time can pass after a schedule point, for which kubernetes can still start the job. For example, if this is set to 100 seconds, kubernetes is allowed to start the job at a maximum 100 seconds after the scheduled time.
Note that the Kubernetes CronJobController checks for things every 10 seconds, for this reason, a deadline below 10 seconds is not allowed, as it may cause your job to never be scheduled.
In addition, kubernetes will stop scheduling jobs if more than 100 schedules were missed (for any reason). This property also controls what time interval should kubernetes consider when counting for missed schedules.
For example, suppose a CronJob is set to schedule a new Job every one minute beginning at 08:30:00, and its
startingDeadline
field is not set. If the CronJob controller happens to be down from 08:29:00 to 10:21:00, the job will not start as the number of missed jobs which missed their schedule is greater than 100. However, ifstartingDeadline
is set to 200 seconds, kubernetes will only count 3 missed schedules, and thus start a new execution at 10:22:00.Default: Duration.seconds(10)
-
getSuccessfulJobsRetained
@Stability(Stable) @Nullable default Number getSuccessfulJobsRetained()
Specifies the number of successful jobs history retained.This would retain the Job and the associated Pod resource and can be useful for debugging.
Default: 3
-
getSuspend
@Stability(Stable) @Nullable default Boolean getSuspend()
Specifies if the cron job should be suspended.Only applies to future executions, current ones are remained untouched.
Default: false
-
getTimeZone
@Stability(Stable) @Nullable default String getTimeZone()
Specifies the timezone for the job.This helps aligining the schedule to follow the specified timezone.
Default: - Timezone of kube-controller-manager process.
-
builder
@Stability(Stable) static CronJobProps.Builder builder()
- Returns:
- a
CronJobProps.Builder
ofCronJobProps
-
-