I have two applications - app1 and app2, where app1 is a config server that holds configs for app2
You need to use initContainers. Following is an example of how you can do in your YAML file
initContainers:
- name: wait-for-other-pod
image: docker.some.image
args:
- /bin/sh
- -c
- >
set -x;
while [ $(curl -sw '%{http_code}' "http://www..com" -o /dev/null) -ne 200 ]; do
sleep 15;
done
I have used curl to hit the health check endpoint, you can use any other UNIX command to check if the other pod is ready.