---
apiVersion: v1
kind: Pod
metadata:
  name: init-pod
  labels:
    app: init
spec:
  initContainers:
    - name: init-myservice
      image: busybox
      command:
        - sh
        - -c
        - until nslookup myservice; do echo waiting for myservice; sleep 2; done;
    - name: init-mydb
      image: busybox
      command:
        - sh
        - -c
        - until nslookup mydb; do echo waiting for mydb; sleep 2; done;
  containers:
    - name: main-containers
      image: busybox
      command:
        - sh
        - -c
        - echo The app is runing! && sleep 3600
