简体   繁体   English

Google Cloud 未在负载均衡器运行状况检查中应用 BackendConfig

[英]Google Cloud not Applying the BackendConfig on the Load Balancer Health Check

I have a deployment.我有一个部署。 The pod container's have no readinessProbe(s), because the healtcheck will be configured using a BackendConfig. pod 容器没有 readinessProbe(s),因为 healtcheck 将使用 BackendConfig 配置。

The service is as follows:服务如下:

---
apiVersion: v1
kind: Service
metadata:
  name: my-app-service
  namespace: my-namespace
  annotations:
    cloud.google.com/neg: '{"ingress": true}'
    cloud.google.com/backend-config: '{"default": "my-app-backendconfig"}'
spec:
  type: NodePort  
  externalTrafficPolicy: Local  
  ports:
  - name: flower-nodeport-port
    port: 80
    targetPort: 5555
    protocol: TCP
  selector:
    app: my-app

And this is the BackendConfig to create the health check:这是创建健康检查的 BackendConfig:

apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
  name: my-app-backendconfig
  namespace: my-namespace
  labels:
    app: my-app
spec:
  healthCheck:
    checkIntervalSec: 20
    timeoutSec: 1
    healthyThreshold: 1
    unhealthyThreshold: 5
    type: TCP        

The problem is that Google Cloud is not applying the healtcheck as I described it.问题是谷歌云没有像我描述的那样应用健康检查。 Check the screenshot below:检查下面的屏幕截图:

在此处输入图像描述

As you can see, values like "Unhealthy threshold" and "Timeout" are not being taken into account.如您所见,没有考虑“不健康阈值”和“超时”等值。

What am I doing wrong?我究竟做错了什么?

If the Pod template for the Service's serving Pods does not have a container with a readiness probe whose attributes can be interpreted as health check parameters, the default values are used to create the health check.如果服务的服务 Pod 的 Pod 模板没有带有准备探测的容器,其属性可以解释为健康检查参数,则默认值用于创建健康检查。 Both the Anthos Ingress controller and the GKE Ingress controller can create a health check using only the default values. Anthos Ingress controller 和 GKE Ingress controller 都可以仅使用默认值创建健康检查。

The ideal way to use the 'BackendConfig' is when the serving pods for your service contains multiple containers, if you're using the Anthos Ingress controller or if you need control over the port used for the load balancer's health checks, then you should use a BackendConfig CDR to define health check parameters.使用“BackendConfig”的理想方式是当您的服务的服务 pod 包含多个容器时,如果您使用的是 Anthos Ingress controller 或者如果您需要控制用于负载均衡器健康检查的端口,那么您应该使用用于定义健康检查参数的 BackendConfig CDR。 Refer to the health check for each backend service corresponding to a Kube.netes Service and Parameters from a readiness probe for more information.有关更多信息,请参阅与Kube.netes 服务对应的每个后端服务的健康检查来自就绪探针的参数

Refer to the similar SO1 , SO2 for more information.有关详细信息,请参阅类似的SO1SO2

Also go through the how health checks work for more information.也可以通过 go 了解健康检查的工作原理

Finally refer to this How to troubleshoot unhealthy backends in Google Cloud Load Balancers may help to resolve your issue.最后参考这个How to troubleshoot unhealthy backends in Google Cloud Load Balancers可能有助于解决您的问题。

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

相关问题 如何在谷歌云中为 websocket 创建健康检查? - How to create a health check for websocket in Google cloud? 由于负载均衡器健康检查,Fargate 容器永远不会被杀死 - Fargate container is never killed because of the load balancer health check GCP Google Cloud - 无法创建负载均衡器 - GCP Google Cloud - Cannot create Load Balancer 如何在 Google Cloud Load Balancer 上记录 SSL/TLS 握手详细信息 - How to log SSL/TLS Handshake details on Google Cloud Load Balancer 如何为 AWS 负载均衡器配置 Google Cloud DNS - How to configure Google Cloud DNS for an AWS Load balancer 如何设置谷歌云负载平衡器以利用清漆中的 http2 支持? - How to setup a google cloud load balancer to take advantage of http2 support in varnish? 我们可以在谷歌云 https 负载均衡器中配置多少个前端公共 ip? - How many frontend public ip can we configure in google cloud https load balancer? 在 Google Cloud 上使用预先创建的静态 IP 地址创建负载均衡器 - Create a Load Balancer with the pre-created static IP address on Google Cloud 谷歌云负载平衡器导致错误 502 - failed_to_pick_backend - Google cloud load balancer causing error 502 - failed_to_pick_backend 在创建 Global HTTPS Google Cloud Load Balancer 时位置有何影响? - How does location matter while creating a Global HTTPS Google Cloud Load Balancer?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM