-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
reconcile AWS NLB attributes on service creation #95247
Conversation
@kishorj: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @kishorj. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign m00nf1sh |
if err := c.reconcileLBAttributes(aws.StringValue(loadBalancer.LoadBalancerArn), annotations); err != nil { | ||
return nil, err | ||
} |
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.
This is just my $0.02 as a very infrequent contributor, but this code seems to be copy-pasted from here: https://github.com/kubernetes/kubernetes/pull/95247/files#diff-3847bd7a991eef9e3fc1c058562e9a7eac0dbfbcefb28d60c9ce03080eb4caffR371
I wonder if that code can be taken out of this greater if/else to reduce duplication. The only snag I see is this brief section that comes after where this was copy-pasted from: https://github.com/kubernetes/kubernetes/pull/95247/files#diff-3847bd7a991eef9e3fc1c058562e9a7eac0dbfbcefb28d60c9ce03080eb4caffR375-R388
However, I would think that running it regardless of the great if/else case would not be harmful... not sure what the core maintainers think about this.
Regardless, I think a comment is needed here. It seems unintuitive to have to do this on creation, so future generations will thank you for explaining it and not relying on git history.
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.
Thanks for the review and the comments. Your concerns on the maintainability are valid.
Since the ELBv2 CreateLoadBalancer
API doesn't support specifying the load balancer attributes, they need to be reconciled separately. Hence the reconcile call immediately after creation. I feel the if-else block is ripe for refactor.
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
/ok-to-test
/approve |
[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 |
Similar ticket in the external provider repo: kubernetes/cloud-provider-aws#180 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The NLB attributes are now reconciled immediately after creating the load balancer. Previously, the LB attributes related annotations were applied only during updates to the service object. This required a two step process to apply the attributes correctly.
Which issue(s) this PR fixes:
Fixes #81584
Fixes #82595
Special notes for your reviewer:
Tested on kops cluster by specifying the following annotations on a service, the load balancer type is 'nlb' -
Test summary
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: