SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top