Skip to content

Instantly share code, notes, and snippets.

@miluna
Created December 2, 2021 15:08
Show Gist options
  • Save miluna/f09980e2fdb730e4d8f140de216d3241 to your computer and use it in GitHub Desktop.
Save miluna/f09980e2fdb730e4d8f140de216d3241 to your computer and use it in GitHub Desktop.
Sample Kubernetes Cronjob yml
apiVersion: batch/v1
kind: CronJob
metadata:
name: <cronjob-name>
spec:
schedule: <cronjob-schedule>
jobTemplate:
spec:
template:
spec:
containers:
- name: <cronjob-name>
image: DOCKERIMAGE
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- sh /opt/<script>.sh
restartPolicy: OnFailure
securityContext:
runAsGroup: 9999
runAsUser: 9999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment