fix: lb leak preventing changes in Load Balancer type annotation after creation#1325
Conversation
|
This issue is currently awaiting triage. If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the The DetailsInstructions 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-sigs/prow repository. |
|
Converting to draft til e2e is reviewed and healthy |
|
/test all |
|
/test pull-cloud-provider-aws-e2e-kubetest2 |
Adds validation to prevent users from changing the Load Balancer type annotation (service.beta.kubernetes.io/aws-load-balancer-type) after the load balancer has been created. This prevents undefined behavior and potential service disruptions. The validation detects the current load balancer type by analyzing the hostname pattern in the service's LoadBalancer status: - Classic Load Balancer: hostname ends with ".elb.amazonaws.com" - Network Load Balancer: hostname ends with ".elb.<region>.amazonaws.com" If a mismatch is detected between the annotation and the existing load balancer type, the controller returns a validation error preventing the update. Relatest to Issue 1254 Signed-off-by: Claude (AI Assistant) <noreply@anthropic.com> Co-Authored-By: Marco Braga <mrbraga@redhat.com>
d95d41a to
54ac0d6
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kmala The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick release-1.34 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR adds validation to prevent users from changing the Load Balancer type annotation (
service.beta.kubernetes.io/aws-load-balancer-type) after the load balancer has already been created. This prevents load balancer resource leaks and potential service disruptions that can occur when attempting to change between Classic Load Balancer (CLB) and Network Load Balancer (NLB) after it has been created.The validation works by:
.elb.amazonaws.com.elb.<region>.amazonaws.comWhich issue(s) this PR fixes:
Fixes #1254
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Note: This PR was assisted by Claude (AI Assistant). Implementation authored by Marco Braga (@mtulio).
Signed-off-by: Claude (AI Assistant) noreply@anthropic.com
Co-Authored-By: Marco Braga mtulio@mtulio.dev