Closed Despire closed 4 months ago
Context-box will continue to restart if MongoDB is not deployed. As Context-box depends solely on mongoDB without which it cannot start.
What about making the context-box
not ready and forbidding it to process any requests? If I am not mistaken something similar works in builder
. builder
doesn't process any request, unless all services (terraformer, ...) that it depends on are ready.
context-box not ready and forbidding it to process any requests?
afaik, this is the default in kubernetes when a service is not ready traffic will not get forwarded to it.
In that case, what do you think about going with the not-ready approach?
That is the idea of this PR
i.e. when the pod is first deployed it will crashloop until the DB is created (I think this is ok)
Then a healthcheck has been added, and if the DB goes down or something while context-box is running the healthcheck will fail and traffic will not get dirrected to context-box until the DB is running again.
You are right, I didn't read this in the PR description.
which will not issue a restart of the context-box, the restart only happens when it is first deployed as a new pod
closes #1325
Context-box will continue to restart if MongoDB is not deployed. As Context-box depends solely on mongoDB without which it cannot start. The current state where contextbox restarts if mongodb is not deployed is okay I think, we can revisit this in the future, but currently without major changes to the context-box service I don't think it's a good idea.
However, I've added more time to check for MongoDB readiness before restarting the service and also added a healthcheck in case the MongoDB pod got terminated (which will not issue a restart of the context-box, the restart only happens when it is first deployed as a new pod)