CronJobs must include a configured deadline. The starting_deadline_seconds attribute in the resource spec (kubernetes_cron_job[].spec.starting_deadline_seconds) must be defined. This ensures missed job executions have a bounded retry window and are not indefinitely retried.
Compliant Code Examples
resource"kubernetes_cron_job""demo2"{metadata{name="demo"}spec{concurrency_policy="Replace"failed_jobs_history_limit=5schedule="1 0 * * *"starting_deadline_seconds=10successful_jobs_history_limit=10job_template{metadata{}spec{backoff_limit=2ttl_seconds_after_finished=10template{metadata{}spec{container{name="hello"image="busybox"command=["/bin/sh","-c","date; echo Hello from the Kubernetes cluster"]}}}}}}}
Non-Compliant Code Examples
resource"kubernetes_cron_job""demo"{metadata{name="demo"}spec{concurrency_policy="Replace"failed_jobs_history_limit=5schedule="1 0 * * *"successful_jobs_history_limit=10job_template{metadata{}spec{backoff_limit=2ttl_seconds_after_finished=10template{metadata{}spec{container{name="hello"image="busybox"command=["/bin/sh","-c","date; echo Hello from the Kubernetes cluster"]}}}}}}}
1
2
rulesets:- Terraform / Kubernetes # Rules to enforce / Kubernetes.
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.