Reputation: 334
I have a service in ECS. When I deploy a new version of the service's task definition, ECS adds the new task, registers it with the target-group, unregisters the old task from the target-group, and then stops the old task.
The problem is, the new task has not had enough successful load balancer health checks to be considered healthy, so now there are no healthy targets in the target-group. 1-2 minutes later, the new task will be considered healthy by the load balancer.
To summarize:
How can I avoid briefly not having any healthy targets in the target-group?
Upvotes: 4
Views: 2200
Reputation: 201088
Please look at the available ECS Service parameters.
Specifically, minimumHealthyPercent
The default settings for minimumHealthyPercent
should be preventing the behavior you describe, so I'm wondering if you have modified the default value. To prevent the behavior you are seeing I would set minimumHealthyPercent
to 100
.
You should also look at the Target Group's deregistration_delay
setting. You may be seeing the current behavior if you changed this setting to a low value. Or you may need to set it higher than the default value of 300
seconds.
Upvotes: 2