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.96k stars 1.47k forks source link

Adopting existing NLBs/TargetGroups that point towards host network pods #3681

Open fvlaicu opened 6 months ago

fvlaicu commented 6 months ago

Is your feature request related to a problem?

We're looking to use the AWS lb controller to manage load balancers on our Kubernetes fleet. Our ingress pods run in the host network and receive the traffic directly from the NLB. To be more clear, we add the AWS instances to the target group and send traffic to the ports on which the ingress pods run. I would like the ability to adopt/import the existing NLBs/TargetGroups as is.

Describe the solution you'd like A description of what you want to happen.

I would like to have a way for the instances that run the ingress pods to be added to the target group without the use of node ports (since the pods are already in the host network).

Describe alternatives you've considered A description of any alternative solutions or features you've considered.

csantanapr commented 6 months ago

Did you try using the TargetGroupBinding ?

With targetType: instance should allow you to point to the instance port

M00nF1sh commented 6 months ago

@fvlaicu the answer provided by fvlaicu is correct, you should use TargetGroupBinding on existing NLB/TargetGroups.

We don't have plans to officially support "adopt" existing resources for Ingress/Services at the moment. Though technically you can hack it by attach required aws tags to existing AWS resource to cheat the controller thus it believe those resources are created by it and use them

fvlaicu commented 6 months ago

I tried earlier to use a loadbalancer type service, however, that changed the target group and added node ports.

M00nF1sh commented 6 months ago

@fvlaicu You need to apply aws tags to existing targetGroups/security groups as well for the lbc to adopt it

M00nF1sh commented 4 months ago

we have a sync up, seems you only want the controller to manage the targets. So targetGroupBinding is the choice which allows you to bind a existing TargetGroup to a Service(you should be able to use a clusterIP or nodePort service)

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

andrew-purdin commented 1 week ago

Just curious @M00nF1sh , if this process works, why isn't it supported or officially documented?