Kubernetes - wait for other pod to be ready

后端 未结 4 1047
难免孤独
难免孤独 2020-12-03 03:07

I have two applications - app1 and app2, where app1 is a config server that holds configs for app2

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 03:33

    Using wait-for-it.sh is actually quite easy:

      initContainers:
      - name: wait-for-app1
        image: image-docker-containing-sh
        args:
        - /bin/sh
        - -c
        - /usr/app/wait-for-it.sh app1: -t 0
    

    Of course retries and timeouts are the way to go, but this works great as a workaround.

提交回复
热议问题