Skip to content

Instantly share code, notes, and snippets.

@geshan
Created March 23, 2021 04:10
Show Gist options
  • Save geshan/9dce563f4c1895e5c8f8c658a8e5a821 to your computer and use it in GitHub Desktop.
Save geshan/9dce563f4c1895e5c8f8c658a8e5a821 to your computer and use it in GitHub Desktop.
Markdium-Kubernetes cron jobs: a hands-on guide to optimally configured crons
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: print-date
spec:
schedule: "*/5 * * * *"
jobTemplate:
spec:
backoffLimit: 5
ttlSecondsAfterFinished: 100
template:
spec:
containers:
- name: print-date
image: node:14-alpine
imagePullPolicy: IfNotPresent
args:
- -e
- "console.log(new Date().toString());"
restartPolicy: OnFailure
parallelism: 1
completions: 1
concurrencyPolicy: "Forbid"
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment