- Newest
- Most votes
- Most comments
Hi Sayak,
To answer your question, let's see the history of why the annotation service.beta.kubernetes.io/aws-load-balancer-type: external
came into being.
There are essentially two main Kubernetes controllers available to manage AWS Load Balancers instances:
- The legacy Kubernetes "Cloud Controller Manager", i.e. AWS cloud provider load balancer controller
- The new recommended "AWS Load Balancer Controller".
The legacy controller for aws until recently had it's code in the Kubernetes repository but I can see this commit which seems to have removed it (Looks like it is being packaged in v1.28.0-alpha.0 release).
The legacy controller used to create the Classic Load Balancers by default and then later fortified to also support Network Load Balancers. Later to support more customisations, the new recommended "AWS Load Balancer Controller" was introduced.
While both legacy cloud controller manager and aws load balancer controller were working together in the cluster, the annotation service.beta.kubernetes.io/aws-load-balancer-type: external
was required. If the value of the annotation is set to external
, the load balancer will be created by the new "AWS Load Balancer Controller".
So while not using the annotation service.beta.kubernetes.io/aws-load-balancer-type: external
with other appropriate annotations will still create the Network Load Balancer for you but it will be created using the legacy AWS cloud provider load balancer controller and not the recommended "AWS Load Balancer Controller". The issues you will face is that the legacy provider is in deprecated mode and hence will not receive any new features and also it is due to be removed all together.
Hopefully, this answers your question.
Relevant content
- asked a month ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
- How can I troubleshoot issues when I use the AWS Load Balancer Controller to create a load balancer?AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Accepting this answer but I it seemed to me like my service was using the recommended "AWS Load Balancer Controller" when a LoadBalancer service was created without the annotation. And I think I have figured it out. There is a MutatingWebhookConfig
aws-load-balancer-webhook
that can mutate all LoadBalancer services and addloadBalancerClass: service.k8s.aws/nlb
to them. And I feel like this is why the new controller is getting used. Do you think this is a correct observation? Here's where I got the info https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/5317c4156c213184c2ba0d6a67cd8ba9206925d9/helm/aws-load-balancer-controller/values.yaml#L352Hi Sayak, Yes, you are correct! This webhook seems to be added very recently on 6th April 2023 using this PR https://github.com/kubernetes-sigs/aws-load-balancer-controller/pull/3139