我在 GCP 上使用 HTTP 负载均衡器,通过 Kubernetes Ingress配置。
看起来健康检查请求的数量非常频繁:
10.0.4.1 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.0.4.1 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.0.4.1 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:27 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:27 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
这是正常/预期的吗?正如你所看到的,我用200
s 回应。我还检查了配置,轮询间隔应该是 60 秒:
nathan@test-k8s-201417:~$ gcloud compute health-checks describe health-check-id
checkIntervalSec: 60
我的期望是每 60 秒进行一次健康检查,而我看到的是每秒 100 秒!
这实际上是一种预期行为,因为 Google 探测器实际上发送的请求比您的健康检查间隔要多。
但是您的后端健康检查将被标记为健康或不健康,具体取决于您设置的时间间隔以及是否收到“200”条消息。这是一些解释此行为的官方文档。