简体   繁体   English

Kubernetes 负载均衡器服务与云负载均衡器

[英]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:

  1. Application LB, via Kubernetes Ingress object.应用程序 LB,通过 Kubernetes Ingress object。 It operates on L7 and provides features related to HTTP它在 L7 上运行并提供与 HTTP 相关的功能
  2. Network LB, via Kubernetes 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.

相关问题 kubernetes LoadBalancer服务 - kubernetes LoadBalancer service 使用 loadBalancer 服务时,无法在 Kubernetes 上生产/消费到 Kafka - Unable to produce/consume to Kafka on Kubernetes when using loadBalancer Service Kubernetes LoadBalancer 服务未获取 ELB 外部 IP 地址 - Kubernetes LoadBalancer service not getting ELB external IP address TLS 不适用于 Kubernetes 中的 LoadBalancer 支持的服务 - TLS doesn't work with LoadBalancer backed Service in Kubernetes istio - 使用vs服务和gw而不是loadbalancer不工作 - istio - using vs service and gw instead loadbalancer not working 服务(LoadBalancer)端口在AWS上不起作用 - Service (LoadBalancer) port not working on aws 如何使用 `service.spec.externalIPs` 而不是 `--type=LoadBalancer` 在 AWS 上公开 Kubernetes 服务? - How to expose a Kubernetes service on AWS using `service.spec.externalIPs` and not `--type=LoadBalancer`? Kubernetes 和 UDP 负载均衡器和基于 IP 的粘性会话 - Kubernetes with an UDP loadbalancer with sticky sessions based on IP 如何自定义由使用AWS NLB作为TCP服务的Kubernetes LoadBalancer类型服务创建的安全组入口规则 - How to customize the Security Group Ingress Rules created by a Kubernetes LoadBalancer type service that uses AWS NLB for TCP services EC2实例在loadbalancer中无法使用 - EC2 instance is out of service in loadbalancer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM