Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apiVersion: batch/v1beta1
- kind: CronJob
- metadata:
- name: example
- namespace: default
- spec:
- schedule: '*/1 * * * *'
- jobTemplate:
- spec:
- template:
- spec:
- initContainers:
- - name: wait-for-service
- image: busybox
- command: ['sh', '-c', 'until nslookup myservice; do echo waiting for myservice; sleep 2; done
- - name: clean-up-db
- image: busybox
- command: ['sh', '-c', 'psql -f clean_up.psql']
- containers:
- - name: fake-job
- image: own-image
- command: ['sh', '-c', 'echo The app is running! && sleep 3600']
- restartPolicy: OnFailure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement