-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add support for NLB instance mode #1832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c021302
to
7b7e922
Compare
7b7e922
to
eea083e
Compare
/ok-to-test |
eea083e
to
c8afd89
Compare
c8afd89
to
d7b26c3
Compare
Codecov Report
@@ Coverage Diff @@
## main #1832 +/- ##
==========================================
+ Coverage 47.62% 47.98% +0.35%
==========================================
Files 110 110
Lines 6110 6177 +67
==========================================
+ Hits 2910 2964 +54
- Misses 2931 2938 +7
- Partials 269 275 +6
Continue to review full report at Codecov.
|
Does this implementation also suffer from kubernetes/cloud-provider-aws#87 with Alternatively, just documenting that if you want Asking due to #1842. It's not directly related due to as it doesn't actually mention |
@TBBle Yes, this initial implementation will still suffer from that NLB issue as well. (NLB team is working on changes on their end to avoid initial targets receive traffic). We might do follow up PRs to optimize the issue in the way as you described. However, it will suffer from the long NLB registration delay(another issue NLB team is working on fixes) you saw in NLB-IP mode, e.g. pod relocates to another Node. |
d7b26c3
to
5574a55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kishorj, M00nF1sh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* add support for NLB instance mode * decouple health check default values from builder task
Fixes: #1744
Overview
The support for NLB instance mode is available from the k8s service controller, and any changes or improvements are tied to the upstream release schedule. In addition, there are also limitations on using CRDs in the in-tree controller.
This PR is for adding support for NLB instance mode in the AWS Load balancer controller. The controller already supports instance mode for ALB, and we will build up on the
TargetGroupBinding
feature for NLB instance mode as well.Moving forward, the k8s AWS service controller will have support for NLB instance mode and CLB with basic features only. For more NLB features like the TargetGroupBinding, proxy v2 support, improved health checks, IP target mode we recommend running the AWS load balancer controller. Each service of type LoadBalancer on AWS k8s is reconciled either by the in-tree controller or the external controller based on the annotations provided the version requirements are met.
k8s version requirement
The instance mode support for service type LoadBalancer requires k8s 1.20 (non-EKS) or later where we've modified the in-tree controller to ignore service with aws-load-balancer-type annotation of
external
ornlb-ip
. For EKS, we've backported the changes to EKS 1.16 and later releases.How to configure load balancer target type?
If the service annotation
service.beta.kubernetes.io/aws-load-balancer-type
is external, this controller will look for an additional annotationservice.beta.kubernetes.io/aws-load-balancer-target-type
to determine the target type. The current supported values for the target types annotation arenlb-instance
andnlb-ip
.Instance target
Example service spec for instance target
IP target
For consistency with instance target mode, IP mode will also be determined based on the following annotations -
For backwards compatibility, the
service.beta.kubernetes.io/aws-load-balancer-type
annotation value ofnlb-ip
will still be interpreted as IP mode NLB.Alternative considered
Modify the in-tree controller to support additional value for the
service.beta.kubernetes.io/aws-load-balancer-type
annotation, for examplePros:
nlb-ip
Cons:
Testing
service.beta.kubernetes.io/aws-load-balancer-target-node-labels
annotation works as expected