Skip to content

Instantly share code, notes, and snippets.

@netrebel
Created November 15, 2019 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netrebel/18ff52fe2406eb9d6dddf6ae279ee3a8 to your computer and use it in GitHub Desktop.
Save netrebel/18ff52fe2406eb9d6dddf6ae279ee3a8 to your computer and use it in GitHub Desktop.
Kubernetes cronjob sample
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hellocron
spec:
schedule: "*/1 * * * *" #Runs every minute (cron syntax) or @hourly.
jobTemplate:
spec:
template:
spec:
containers:
- name: hellocron
image: busybox
args:
- /bin/sh
- -c
- date; echo Hello from your Kubernetes cluster
restartPolicy: OnFailure #could also be Always or Never
suspend: false #Set to true if you want to suspend in the future
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment