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.93k stars 1.46k forks source link

Skip nodes from target group registering #3036

Closed mballoni closed 1 year ago

mballoni commented 1 year ago

I have a cluster where some node (or nodes) are there only to serve some very particular critical work (Karpenter, for instance). These nodes already have some taints to avoid other non critical pods scheduling.

However when a new Load Balancer (ALB, in my case) is created this node is added to its Target Group.

My AWS LB Controller installation is made by helm charts.

Proposed solution:

Allow configuring target group label node selection (or allow/disallow list). Something like:

nodeTargetGroupSelection:
  matchExpressions:
    - key: aws-controller/dont-target-me
      operator: DoesNotExist

Describe alternatives you've considered

In my research I've found some references regarding Custom Node selectors with TargetGroupdBinding CRDs but its not clear if its possible to do it with ALBs created by Ingress configurations.

Thank you!!

kishorj commented 1 year ago

@mballoni, you can specify target node labels via ingress annotation - live doc: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#target-node-labels

mballoni commented 1 year ago

@kishorj awesome!! Didn't noticed that configuration! Thank you.