Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. apiVersion: batch/v1beta1
  2. kind: CronJob
  3. metadata:
  4. name: example
  5. namespace: default
  6. spec:
  7. schedule: '*/1 * * * *'
  8. jobTemplate:
  9. spec:
  10. template:
  11. spec:
  12. initContainers:
  13. - name: wait-for-service
  14. image: busybox
  15. command: ['sh', '-c', 'until nslookup myservice; do echo waiting for myservice; sleep 2; done
  16. - name: clean-up-db
  17. image: busybox
  18. command: ['sh', '-c', 'psql -f clean_up.psql']
  19. containers:
  20. - name: fake-job
  21. image: own-image
  22. command: ['sh', '-c', 'echo The app is running! && sleep 3600']
  23. restartPolicy: OnFailure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement