0

我已经使用 httpGet 配置了活性探针,但它失败了*error Client.Timeout exceeded while awaiting headers*

但是相同的 API 在容器内部(使用 curl)和容器外部(邮递员)都可以正常工作。我尝试在 liveness 探针中添加主机属性,但没有运气。

知道出了什么问题。

活性探针:

 livenessProbe:
        initialDelaySeconds: 45
        periodSeconds: 10
        httpGet:
           path: /health
           port: xxxxx
        timeoutSeconds: 5

版本详情:

OpenShift Master->v3.9.0+ba7faec-1
Kubernetes Master->v1.9.1+a0ce1bc657
OpenShift Web Console->v3.9.0+b600d46-dirty
4

1 回答 1

1

尝试将initialDelaySeconds, 端口调低,并检查是否存在导致加载缓慢的传递特性(例如 PVC):

livenessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 200
  timeoutSeconds: 10
  periodSeconds: 10
  successThreshold: 1
  failureThreshold: 5

PS:要成功进行探测验证,您的 HTTP 返回状态必须大于或等于 200 且小于 400。

希望这可以帮助

于 2019-08-05T19:23:13.153 回答