[英]Kubernetes loadbalancer service vs cloud loadbalancer
In Kubernetes configuration, for external service component we use:在 Kubernetes 配置中,我们使用的外部服务组件:
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?如果我们在 AWS 等云提供商内部运行 k8s 集群,它提供了自己的负载均衡器,那么这一切是如何工作的呢? 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 AWS现在接手开源项目: 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.)它适用于 EKS(最简单)集群以及非 EKS 集群(需要安装 aws vpc cni 等才能使IP
目标模式工作,如果您有对等 VPC 环境,则需要这样做。)
This is the official/native solution of managing AWS LB(aka ELBv2) resources(App ELB, Network ELB) using K8s.这是使用 K8s 管理 AWS LB(又名 ELBv2)资源(App ELB、网络 ELB)的官方/原生解决方案。 Kubernetes in-tree controller always reconciles Service
object with type: LoadBalancer
Kubernetes in-tree controller 始终协调Service
object 与type: LoadBalancer
Once configured correctly, AWS LB controller will manage the following 2 types of LBs:正确配置后,AWS LB controller 将管理以下 2 种类型的 LB:
Ingress
object.应用程序 LB,通过 Kubernetes Ingress
object。 It operates on L7 and provides features related to HTTP它在 L7 上运行并提供与 HTTP 相关的功能Service
object with correct annotations .网络 LB,通过带有正确注释的 Kubernetes Service
object 。 It operates on L4 and provides less features but claimed MUCH higher throughput.它在 L4 上运行并提供较少的功能,但声称吞吐量要高得多。 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.据我所知,这在与external-dns
一起使用时效果最好——它会自动使用您的 LB A 记录更新您的 Route53 记录,从而使整个服务发现解决方案成为 k8s-y。
Also in general, should prevent usage of classic ELB, as it's marked as deprecated by AWS.同样,一般来说,应该防止使用经典 ELB,因为它被 AWS 标记为已弃用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.