M.H*_*Hol 2 google-health google-cloud-platform kubernetes
嗨,我尝试将自定义运行状况检查与 GCP LoadBalancer 结合使用。
我已经添加readinessProbe&livenessProbe像这样:
readinessProbe:
httpGet:
path: /health
port: dash
initialDelaySeconds: 5
periodSeconds: 1
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 10
livenessProbe:
httpGet:
path: /health
port: dash
initialDelaySeconds: 5
periodSeconds: 1
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 10
Run Code Online (Sandbox Code Playgroud)
但是当我创建我的入口时,我没有得到我的自定义健康检查
我最终确定了一个答案。我试图做的事情是不可能的。我的 GCE Ingress 在端口上使用了后端80。但是在我的 ReadinessProbe 中,我告诉他检查端口8080和/health路径。这是不可能的!
Ingress backend 中声明的服务端口必须与readinessProbe. 只有路径可以不同。如果我们不尊重这种模式,那就是/与 Health Check GCP 路径相关联。
从网络的角度来看,这是合乎逻辑的,健康检查 GCP 在 Kube 集群“外”,如果我们告诉它在端口上路由80而我们ReadinessProbe在另一个端口上,它如何确保即使该端口与ReadinessProbe 满足端口80(它必须路由流量的端口)也会响应。
综上所述,Ingress 中声明的后端端口必须readinessProbe在同一个端口上。我们唯一可以自定义的是路径。
| 归档时间: |
|
| 查看次数: |
1309 次 |
| 最近记录: |