Kubernetes服务的LoadBalancer和外部IP类型之间有什么区别 [英] What is the difference between LoadBalancer and External IPs types of Kubernetes services

查看:91
本文介绍了Kubernetes服务的LoadBalancer和外部IP类型之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Kubernetes服务,但是对于服务中外部IP 的参数有些困惑:

I am using a Kubernetes service, but I am a little confused about the parameter of External IPs in service:

如果有外部IP路由到一个或多个集群节点,则Kubernetes服务可以在这些外部IP上公开.使用服务端口上的外部IP(作为目标IP)进入群集的流量将被路由到服务端点之一.外部IP不受Kubernetes的管理,是集群管理员的责任.

If there are external IPs that route to one or more cluster nodes, Kubernetes services can be exposed on those external IPs. Traffic that ingresses into the cluster with the external IP (as destination IP), on the service port, will be routed to one of the service endpoints. External IPs are not managed by Kubernetes and are the responsibility of the cluster administrator.

我不确定负载均衡器类型的服务使用外部IP的服务之间的区别.

I am not sure the difference between the Load Balancer type service and the service which uses External IPs.

我可以使用负载均衡器类型的服务,然后云提供商可以对服务进行负载均衡.

I can use service with Load Balancer type, then the service can be load balanced by cloud providers.

但是当我将ClusterIP类型与 External IPs 参数一起使用时,我也可以获得负载平衡能力.

But when I use ClusterIP type with External IPs parameter, I can also get the load balance ability.

那有什么区别?为什么具有此外部IP 参数?

So what the difference? Why have this External IPs parameter?

推荐答案

您是对的,它们都是在外部公开服务的两种方式,而且它们都将到达所讨论的服务所连接的所有Pod,但基础架构是正确的允许它有所不同.

You are right that they are both ways of exposing services externally, and that they will both reach all of the pods connected by the service in question, but the infrastructure that allows it is different.

对于LoadBalancer类型,在支持外部负载平衡器的云提供商上,将为您提供一个.这与将IP地址简单地附加到节点上有所不同.在AWS中,配置ELB和附加EIP之间是有区别的.然后,这些将暗示与安全组控件,加密的流量终止等方面的差异.

With a LoadBalancer type, on cloud providers which support external load balancers, one will be provisioned for you. This comes with differences from simply attaching an IP address to a node. Within AWS it will be the difference between provisioning an ELB and attaching a EIP. Those will then imply differences with for example security group controls, encrypted traffic termination and so on.

另一个重要的区别是,如果在受支持的云环境中,Kubernetes会自动设置LoadBalancers,而外部IP是由您手动设置的,这可能意味着或多或少的灵活性,具体取决于您的设置.请参阅更多文档.

Another important difference is that while LoadBalancers are provisioned automatically by Kubernetes if you're in a supported cloud environment, External IPs are manually provisioned by you, which might mean more or less flexibility, depending on your setup. Please see the docs for more.

这篇关于Kubernetes服务的LoadBalancer和外部IP类型之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆