Creating an internet-facing load balancer consists of the same steps as an internal load balancer, but there's no need for an annotation (service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0):
$ cat external-elb.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx-external
spec:
ports:
- protocol: TCP
port: 80
type: LoadBalancer
selector:
project: devops-with-kubernetes
app: nginx
$ kubectl create -f external-elb.yaml
service "nginx-external" created
When you check the AWS Web Console, you can see that Scheme is internet-facing as follows:
You can access the ELB from your laptop as well:
As you can see from the preceding screenshots, the EKS cloud provider is integrated into Kubernetes Service, which launches a classic ELB. This feature is very powerful for scaling out the traffic volume that dispatches to multiple pods.
EKS has also already begun to support the use of Network Load Balancer (NLB), the new version of L4 load balancer in AWS.
In order to use NLB, you need an additional annotation. This annotation is as follows:
metadata:
name: nginx-external
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"