Employing Init Containers for orderly pod bring-up
Liveness and readiness probes are great. They recognize that, at startup, there may be a period where the container is not ready yet, but shouldn't be considered failed. To accommodate that there is the initialDelayInSeconds
setting where containers will not be considered failed. But what if this initial delay is potentially very long? Maybe, in most cases, a container is ready after a couple of seconds and ready to process requests, but because the initial delay is set to five minutes just in case, we waste a lot of time when the container is idle. If the container is part of a high-traffic service, then many instances can all sit idle for five minutes after each upgrade and pretty much make the service unavailable.
Init Containers address this problem. A pod may have a set of Init Containers that run to completion before other containers are started. An Init Container can take care of all the non-deterministic initialization and let application...