Guest User

Untitled

a guest
Nov 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. containers:
  2. - name: main
  3. image: gcr.io/some/image:latest
  4. command: ["/bin/bash", "-c"]
  5. args:
  6. - |
  7. trap "touch /tmp/pod/main-terminated" EXIT
  8. /my-batch-job/bin/main --config=/config/my-job-config.yaml
  9. volumeMounts:
  10. - mountPath: /tmp/pod
  11. name: tmp-pod
  12. - name: envoy
  13. image: gcr.io/our-envoy-plus-bash-image:latest
  14. command: ["/bin/bash", "-c"]
  15. args:
  16. - |
  17. /usr/local/bin/envoy --config-path=/my-batch-job/etc/envoy.json &
  18. CHILD_PID=$!
  19. (while true; do if [[ -f "/tmp/pod/main-terminated" ]]; then kill $CHILD_PID; fi; sleep 1; done) &
  20. wait $CHILD_PID
  21. if [[ -f "/tmp/pod/main-terminated" ]]; then exit 0; fi
  22. volumeMounts:
  23. - mountPath: /tmp/pod
  24. name: tmp-pod
  25. readOnly: true
  26. volumes:
  27. - name: tmp-pod
  28. emptyDir: {}
Add Comment
Please, Sign In to add comment