When does the Load Balancer start sending traffic to a container

I have a service running Tomcat containers. I defined a health check on it - the health check succeed once the application is fully started. Rancher UI shows the container in Initializing state until the health check passes. The service is running with a scale of 2 containers.

The scenario is let’s say I destroy one of the 2 container, Rancher correctly starts a new one. The new container starts and goes into Initializing state until the health check passes.

However, it looks like the Load Balancer start sending requests to it before it’s fully up - i.e. the balancer does not seem to wait for the health check to succeed before using the new container as a target.

That’s not too good for 0-downtime deployment. Is that the expected behavior or am I missing something?

I did some tests today and it does seem like the Load Balancer is waiting for the container to be fully up - i.e. pass health check - before directing requests to it.

It would be good to get a confirmation. I can add it to the documentation if this is the confirmed behavior.

Yes, the load balancer will wait for the container to be fully up before sending traffic to it.