Kubernetes allow us to bind services to a load balancers using ingress type or bind those services to an a AWS target group.
Target group binding
To allow EKS to create a manage Applications load balancer and Network load balancer inside the manifesto of k8s services we need to install this . You have to create a fargate profile on "kube-system" namespace to allow schedule this kind of pods using the key "name" and label "aws-load-balancer-controller" (only pods with this label will be placed in this namespace). Then you need to add to our repository the container controller image "public.ecr.aws/eks/aws-load-balancer-controller".
The next step is to install the aws load balancer controller into our cluster.
helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
-n kube-system \
--set clusterName=staging \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller \
--set region=us-east-1 \
--set vpcId=vpc-fe12949b \
--set image.repository=350572149155.dkr.ecr.region-code.amazonaws.com/amazon/aws-load-balancer-controller
If you want to use an existing ALB, you have to create a Target group with type "IP address" and then create a TargetGroupBinding manifest for each service. Finally you have to associate the ALB with the target group using a rule.