Skip to content

Instantly share code, notes, and snippets.

@gengwg
Created April 20, 2022 16:16
Show Gist options
  • Save gengwg/e9046baca15bce79c182d3a35eeb92ad to your computer and use it in GitHub Desktop.
Save gengwg/e9046baca15bce79c182d3a35eeb92ad to your computer and use it in GitHub Desktop.
apiVersion: batch/v1
kind: CronJob
metadata:
name: example
spec:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
jobTemplate:
spec:
activeDeadlineSeconds: 600
backoffLimit: 3
template:
spec:
containers:
- image: busybox:1.31.1
command:
- sleep
- "10" # increase to 100 to test successful
imagePullPolicy: Always
name: mycontainer
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
ttlSecondsAfterFinished: 180
schedule: '*/1 * * * *'
successfulJobsHistoryLimit: 3
suspend: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment