- Newest
- Most votes
- Most comments
For Network Load Balancers (NLBs) with UDP-based applications on EKS, the target registration time you're experiencing is longer than what your health check settings would suggest.
There are a few important points to understand:
-
For newly registered targets, only a single successful health check is required to consider the target healthy, regardless of the healthy threshold count setting. The healthy threshold count only applies when a target is transitioning from an unhealthy state back to a healthy state.
-
The delay you're experiencing might be related to other factors beyond just the health check settings. When a new pod comes up in your EKS cluster, there are several processes that need to complete before it's fully registered with the NLB target group.
To reduce the registration time, consider these approaches:
-
Verify that your pods are actually ready to receive traffic when they start up. If your application takes time to initialize, the health checks will fail until initialization is complete.
-
You could modify the target group attributes using the AWS CLI. For example, you might want to adjust the deregistration delay timeout:
aws elbv2 modify-target-group-attributes --target-group-arn <your-target-group-arn> --attributes Key=deregistration_delay.timeout_seconds,Value=<lower-value>
-
Consider implementing lifecycle hooks in your Auto Scaling group if you're using one, which can help manage the transition states of your instances.
-
For EKS specifically, ensure that your readiness probes are properly configured and aligned with your NLB health check expectations.
-
Check if there are any network policies or security groups that might be delaying the health check communication.
The discrepancy between your expected 10-second registration time and the observed 40-50 seconds suggests there might be additional factors in your EKS environment affecting the registration process. It could be worth investigating if there are any EKS-specific settings or container startup procedures contributing to this delay.
Sources
Optimize load balancer health check parameters for Amazon ECS - Amazon Elastic Container Service
Use ModifyTargetGroupAttributes with a CLI - AWS SDK Code Examples
Target Group - Only send traffic to healthy nodes | AWS re:Post
Relevant content
- asked 3 years ago
