karthikvee

init-myapp.yaml

Aug 19th, 2021
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: myapp-pod
  5. labels:
  6. app: myapp
  7. spec:
  8. containers:
  9. - name: myapp-container
  10. image: busybox:1.28
  11. command: ['sh', '-c', 'echo The app is running! && sleep 3600']
  12. initContainers:
  13. - name: init-myservice
  14. image: busybox:1.28
  15. command: ['sh', '-c', "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
  16. - name: init-mydb
  17. image: busybox:1.28
  18. command: ['sh', '-c', "until nslookup mydb.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for mydb; sleep 2; done"]
Advertisement
Add Comment
Please, Sign In to add comment