【发布时间】:2016-05-23 20:45:15
【问题描述】:
在使用 Google Container Engine 时 - 人们会推荐 GCP 的本机负载均衡器还是 Kubernetes Service type = LoadBalancer 选项?
人们推荐哪些?
【问题讨论】:
标签: google-cloud-platform google-kubernetes-engine
在使用 Google Container Engine 时 - 人们会推荐 GCP 的本机负载均衡器还是 Kubernetes Service type = LoadBalancer 选项?
人们推荐哪些?
【问题讨论】:
标签: google-cloud-platform google-kubernetes-engine
在服务资源清单中,如果你设置了Type to LoadBalancer,Kubernetes on GKE(Google Container Engine)会使用GCE自动设置TCP负载均衡(L4 Load balancer)。您将不得不使用您自己的自定义服务器或 nginx/apache 之类的东西来终止 pod 中的连接。
如果您的目标是设置 L7 负载均衡器(HTTP/HTTPS),最好使用Ingress resource in Kubernetes(以v1.1 开头)。 GKE 将为此设置自动设置 GCE HTTP/HTTPS L7 负载平衡。这种设置有以下优点:
URL Maps 来配置它)。Target proxies 进行配置)。health checks。更多信息请访问GKE page about setting up HTTP load balancing。
请记住,GKE 将自动为上述两种用例使用可用的 GCE 负载平衡器支持,您无需手动设置 GCE load balancing。
【讨论】:
在 Google Container Engine 上将服务类型设置为 LoadBalancer 将为您配置 GCP 负载均衡器。见Creating an External Load Balancer 和Services: Type LoadBalancer。
【讨论】: