Liveness 探测失败:超时:1 秒内无法连接服务“:8080”

Liveness probe failed: timeout: failed to connect service ":8080" within 1s

在使用 minikube 在 Kubernetes 上部署微服务时,我遇到了 Liveness 探测失败的问题。基于这个答案,我将 liveness probe 的 timeoutSeconds 从 1 更改为 10,但问题并未解决。

错误说,

Liveness probe failed: timeout: failed to connect service ":8080" within 1s
Back-off restarting failed container. 

我还能做些什么来解决这个问题?

我通过增加超时和添加 startupProbe 修复了它:

    readinessProbe:
       initialDelaySeconds: 5
       timeoutSeconds: 3
       successThreshold: 1
       failureThreshold: 3
       periodSeconds: 5
       exec:
         command: ["/bin/grpc_health_probe", "-addr=:8080"]
     livenessProbe:
       initialDelaySeconds: 15
       #timeoutSeconds: 3
       periodSeconds: 5
       successThreshold: 1
       failureThreshold: 3
       exec:
         command: ["/bin/grpc_health_probe", "-addr=:8080"]
     startupProbe:
       exec:
         command: [ "/bin/grpc_health_probe", "-addr=:8080" ]
       failureThreshold: 30
       periodSeconds: 10