Skip to content

Improvement for k8s.io/docs/concepts/workloads/controllers/cron-jobs/ #51861

@tbrownaw

Description

@tbrownaw

There is a section that starts:

For every CronJob, the CronJob Controller checks how many schedules it missed in the duration from its last scheduled time until now. If there are more than 100 missed schedules, then it does not start the Job and logs the error.

Cannot determine if job needs to be started. Too many missed start time (> 100). Set or decrease .spec.startingDeadlineSeconds or check clock skew.

I'm running a 1.31 version, and this message and described behavior does not match what I observe. The first sentence "Cannot determine if job needs to be started." is missing, and the wording of the rest is slightly different. Additionally, the job does in fact start once the previous job completes.

The actual message I see is

too many missed start times. Set or decrease .spec.startingDeadlineSeconds or check clock skew

CronJob used for testing (best run overnight because of how long the sleep is):

apiVersion: batch/v1
kind: CronJob
metadata:
  name: testcronjob
spec:
  jobTemplate:
    metadata:
      name: testcronjob
    spec:
      template:
        spec:
          containers:
          - image: bash
            args:
              - "-c"
              - "sleep 12125"
            name: testcronjob
            resources: {}
          restartPolicy: OnFailure
  schedule: '* * * * *'
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 10
  failedJobsHistoryLimit: 10

Version:

$ kubectl version
Client Version: v1.32.0
Kustomize Version: v5.5.0
Server Version: v1.31.4+k3s1

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions