Last active
September 2, 2019 20:50
-
-
Save knil-sama/1fb0e7aa49469e4ab28b4b88d7ed1eec to your computer and use it in GitHub Desktop.
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: 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: wait-for-db | |
image: postgres | |
command: ['pg_isready', '-h', 'someremotehost'] | |
- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment