Setting up a LoadBalancer Service
LoadBalancer is a special Service type in Kubernetes that provisions a load balancer based on where your cluster is running. For instance, in AWS, Kubernetes will provision an Elastic Load Balancer.
Important note
For a full list of LoadBalancer services and configurations, check the documentation for Kubernetes Services at https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer.
Unlike with ClusterIP
or NodePort, we can amend the functionality of a LoadBalancer Service in cloud-specific ways. Generally, this is done using an annotations block in the Service YAML file – which, as we've discussed before, is just a set of keys and values. To see how this is done for AWS, let's review the spec for a LoadBalancer Service:
loadbalancer-service.yaml
apiVersion: v1 kind: Service metadata: name: my-svc annotations: service.beta.kubernetes.io/aws-load-balancer...