Created
November 15, 2019 00:43
-
-
Save netrebel/18ff52fe2406eb9d6dddf6ae279ee3a8 to your computer and use it in GitHub Desktop.
Kubernetes cronjob sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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