move wait-for-db from initContainer to container to support istio inje…#265
move wait-for-db from initContainer to container to support istio inje…#265
Conversation
|
oliverguenther
left a comment
There was a problem hiding this comment.
We use the check-db-ready to block spawning the main application container, which is not guaranteed if they are running as a multi-container pod. In my understanding, they will both be started in parallel, which is not what we want.
In our environment we are using rke2 for kubernetes and istio for the service mesh. Given that the wait-for-db container is defined as an initContainer, it runs prior to the istio-proxy, thus can not connect to the database.
This proposed change moves the container element to include the wait-for-db definition and adds an empty list for initContainers. This change, along with an istio setting of holdApplicationUntilProxyStarts=true, allows the istio-proxy to execute, setting up the required networking to access the database.