Interface CronJobProps

    • 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, if startingDeadline 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