kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.83k stars 1.41k forks source link

Ignore manual added resources to ALB #3763

Open martin-finalis opened 3 days ago

martin-finalis commented 3 days ago

Is your feature request related to a problem? I am trying to avoid alb controller to remove listeners that are being added outside the controller. For example, some lambda functions are being created with node + serverless framework (which adds itself the rule in the listener). As soon as the controller starts reconciling, those rules are deleted.

Describe the solution you'd like Some way to instruct alb controller that should ignore some rules.

Describe alternatives you've considered I tried external-managed-tags without success.

oliviassss commented 3 days ago

@martin-finalis, The controller reconciles per the manifest as other k8s controllers do, with that said, it is supposed to manage the resources created by it, and to revert any manual modifications to them. We call out in the live doc: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.8/how-it-works/

In your use case, iiuc, the listeners are created by the controller, but the rules are added externally and got reverted?I believe that's because the controller is reconciling the listeners per your manifest. So if you really want to bypass this, you can remove the tags for your listeners, but be mindful that the controller will not manage the listeners anymore once removed.

elbv2.k8s.aws/cluster: ${clusterName}
ingress.k8s.aws/stack: ${stackID}
ingress.k8s.aws/resource: ${resourceID}

You can check here for more details: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.8/guide/ingress/annotations/#resource-tags