简体   繁体   English

GKE内部负载均衡器无法创建

[英]GKE Internal Load Balancer is failing to create

I have a gke cluster that has an http(s) load balancer, which uses the RATE balancing mode as per the docs . 我有一个带有http(s)负载均衡器的gke集群,该集群按照docs使用RATE均衡模式。

I'm trying to expose a workload on this cluster to App Engine using an internal load balancer. 我正在尝试使用内部负载平衡器将此群集上的工作负载公开给App Engine。 Both services are on the same network in the same region. 两种服务都位于同一区域的同一网络上。

However, when I try to create the load balancer, it fails with this error. 但是,当我尝试创建负载均衡器时,它失败并显示此错误。

Error creating load balancer (will retry): failed to ensure load balancer for service default/internal-es-lb: googleapi: Error 400: Validation failed for instance 'projects/PROJECT-NAME/zones/us-central1-a/instances/gke-staging-default-pool-85830c52-g6tg': instance may belong to at most one load-balanced instance group., instanceInMultipleLoadBalancedIgs

There are a couple of things that are weird. 有几件事很奇怪。
1. The internal LB worked earlier today. 1.内部LB今天早些时候工作。
2. The http(s) load balancer is (was) throwing the same error as the internal LB, even when it's the only load balancer on the cluster 2. http负载均衡器正在抛出与内部LB相同的错误,即使它是集群上唯一的负载均衡器
3. When I create the LB with my service yaml, it creates a new/different instance group than my target pool 3.当我使用服务Yaml创建LB时,它会创建一个比目标池新的/不同的实例组

Here's my service yaml: 这是我的服务Yaml:

apiVersion: v1
kind: Service
metadata:
  name: internal-es-lb
  annotations:
    cloud.google.com/load-balancer-type: "Internal"
  labels:
    app: internal-es-lb
spec:
  type: LoadBalancer
  loadBalancerIP: 10.128.0.4
  loadBalancerSourceRanges: [0.0.0.0/0]
  ports:
    - port: 80
      targetPort: 9200
      protocol: TCP
      name: http-es-lb
  selector:
    app: elastic-master

I think I understand the error to mean that the there can only be one instance group, so is it possible to specify the instance group in the yaml? 我认为我理解该错误是指只能有一个实例组,因此可以在yaml中指定实例组吗? Or, is there some other solution? 或者,还有其他解决方案吗? Thanks! 谢谢!

Update: the internal LBs were working earlier today because I hadn't implemented the http(s) LB yet. 更新:由于我尚未实现http(s)LB,所以内部LB今天早些时候可以工作。 With the http(s) lb in place, these fail. 有了http(s)磅后,这些操作将失败。 Would love to know how to make this all work together since the docs aren't very clear. 因为文档不是很清楚,所以我们想知道如何使所有这些一起工作。

Update to the Update: If I create the internal LBs first and then the http(s) LB applied to the new instance group, it sorta works. 更新到更新:如果我先创建内部LB,然后再将HTTP LB应用于新实例组,则它可以工作。 Everything is being routed and loaded correctly, but the google console throws a bunch of errors, so I don't know if this is the recommended way. 一切都已正确路由和加载,但是Google控制台抛出了许多错误,所以我不知道这是否是推荐的方法。

When you create a HTTP(S) LB, you are likely creating a backend that uses a Managed Instance Group (MIG). 创建HTTP(S)LB时,可能会创建使用托管实例组(MIG)的后端。 Instances (including GKE Nodes) can only be part of a single MIG at any given time. 在任何给定时间,实例(包括GKE节点)只能是单个MIG的一部分。

When you create a ILB service through GKE, the backends are all unmanaged instance groups, so the instances can be reused. 通过GKE创建ILB服务时,后端都是非托管实例组,因此可以重复使用这些实例。

The recommended way to address this is to use Kubernetes Ingress instead of the GCE L7LB since the Ingress will also use unmanaged instance groups. 解决此问题的推荐方法是使用Kubernetes Ingress而不是GCE L7LB,因为Ingress还将使用非托管实例组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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