简体   繁体   中英

Kubernetes loadbalancer service vs cloud loadbalancer

In Kubernetes configuration, for external service component we use:

type: LoadBalancer

If we have k8s cluster running inside a cloud provider like AWS, which provides it own loadbalancer, how does all this work then? Do we need to configure so that one of these loadbalancers is not active?

AWS now takes over the open source project: https://kubernetes-sigs.github.io/aws-load-balancer-controller

It works with EKS(easiest) clusters as well as non-EKS clusters (need to install aws vpc cni etc to make IP target mode work, which is required if you have a peered VPC environment.)

This is the official/native solution of managing AWS LB(aka ELBv2) resources(App ELB, Network ELB) using K8s. Kubernetes in-tree controller always reconciles Service object with type: LoadBalancer

Once configured correctly, AWS LB controller will manage the following 2 types of LBs:

  1. Application LB, via Kubernetes Ingress object. It operates on L7 and provides features related to HTTP
  2. Network LB, via Kubernetes Service object with correct annotations . It operates on L4 and provides less features but claimed MUCH higher throughput.

To my knowledge, this works best when used with external-dns together -- it automatically updates your Route53 record with your LB A records thus makes the whole service discovery solution k8s-y.

Also in general, should prevent usage of classic ELB, as it's marked as deprecated by AWS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM