I have an application and a database server in a pod (2 Containers).
The current problem is that the database service is available later than the application and the application itself fails when it is started (database Connection needed).
Unfortunately, it isn’t possible to store a database-connection-check in the application itself.
Due to the structural design, it’s not possible to separate the application/database into different pods and the possible work of an InitContainer, which is intended to delay the start of the application pod.
I didn’t find a way to delay the start of a container in a pod, for example by 5-10 seconds, in the Kubernetes/Rancher-environment (only under Docker/docker swarm).
I would like to know if there is anyone with similar cases/problems and what solutions have been taken.
It’s important that the application and the database are in one pod.
Thank you for your suggestions!