gpt4 book ai didi

nginx - livenessprobe 因 EOF 失败(nginx 容器)

转载 作者:行者123 更新时间:2023-12-02 12:31:34 25 4
gpt4 key购买 nike

我有一个运行 nginx 的容器,它监听 pod id 的端口 443。它本身运行良好;但是,如果我指定了一个活性探测,那么探测将失败

5m54s       Warning   Unhealthy          Pod           Liveness probe failed: Get https://192.168.2.243:443/: EOF

有人可以请指出我做错了什么吗?谢谢。

当它在没有活性探针的情况下运行时:
root@ip-192-168-2-243:/etc/nginx# netstat -tupln | grep 443
tcp 0 0 192.168.2.243:1443 0.0.0.0:* LISTEN -
tcp 0 0 192.168.2.243:443 0.0.0.0:* LISTEN 7/nginx: master pro

root@ip-192-168-2-243:/# telnet 192.168.2.243 443
Trying 192.168.2.243...
Connected to 192.168.2.243.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

root@ip-192-168-2-243:/# curl https://192.168.2.243
curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs

探针声明:
livenessProbe:
initialDelaySeconds: 10
timeoutSeconds: 4
failureThreshold: 3
httpGet:
scheme: HTTPS
port: 443

Nginx 拆分客户端声明:
split_clients "${remote_addr}AAA" $localips {
* 192.168.2.243;
}

数据平面/kubelet.service-ip:


事件:
skwok-mbp:kubernetes skwok$ kubectl get event -w
LAST SEEN TYPE REASON OBJECT MESSAGE
7s Normal SuccessfulDelete statefulset/mnsvr delete Pod mnsvr-0 in StatefulSet mnsvr successful
0s Normal Killing pod/mnsvr-0 Killing container with id docker://mnsvr-proxy:Need to kill Pod
0s Normal Killing pod/mnsvr-0 Killing container with id docker://mnsvr-node0:Need to kill Pod
0s Normal Killing pod/mnsvr-0 Killing container with id docker://mnsvr-node1:Need to kill Pod
0s Normal SuccessfulCreate statefulset/mnsvr create Pod mnsvr-0 in StatefulSet mnsvr successful
0s Normal Scheduled pod/mnsvr-0 Successfully assigned staging/mnsvr-0 to ip-192-168-2-243.us-west-2.compute.internal
0s Normal Pulled pod/mnsvr-0 Container image "171421899218.dkr.ecr.us-west-2.amazonaws.com/mnsvr-proxy:0.96" already present on machine
0s Normal Created pod/mnsvr-0 Created container
0s Normal Started pod/mnsvr-0 Started container
0s Normal Pulled pod/mnsvr-0 Container image "171421899218.dkr.ecr.us-west-2.amazonaws.com/mnsvr:1.1" already present on machine
0s Normal Created pod/mnsvr-0 Created container
0s Normal Started pod/mnsvr-0 Started container
0s Normal Pulled pod/mnsvr-0 Container image "171421899218.dkr.ecr.us-west-2.amazonaws.com/mnsvr:1.1" already present on machine
0s Normal Created pod/mnsvr-0 Created container
0s Normal Started pod/mnsvr-0 Started container
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Normal Killing pod/mnsvr-0 Killing container with id docker://mnsvr-proxy:Container failed liveness probe.. Container will be killed and recreated.
0s Normal Pulled pod/mnsvr-0 Container image "171421899218.dkr.ecr.us-west-2.amazonaws.com/mnsvr-proxy:0.96" already present on machine
0s Normal Created pod/mnsvr-0 Created container
0s Normal Started pod/mnsvr-0 Started container
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Normal Killing pod/mnsvr-0 Killing container with id docker://mnsvr-proxy:Container failed liveness probe.. Container will be killed and recreated.
0s Normal Pulled pod/mnsvr-0 Container image "171421899218.dkr.ecr.us-west-2.amazonaws.com/mnsvr-proxy:0.96" already present on machine
0s Normal Created pod/mnsvr-0 Created container
0s Normal Started pod/mnsvr-0 Started container
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Warning Unhealthy pod/mnsvr-0 Liveness probe failed: Get https://192.168.2.243:443/: EOF
0s Warning BackOff pod/mnsvr-0 Back-off restarting failed container

主机/host.messages-ip-192-168-2-243:
host/host.messages-ip-192-168-2-243

应用程序/mnsvr-代理:
enter image description here

最佳答案

我认为 EOF 是 TLS 握手问题的症状。我目前也看到了同样的情况。

某些版本的 curl 可以产生类似的结果。 curl 的解决方法似乎是使用 --tls-max 1.2 .

我目前的怀疑是客户端(探针)试图与服务器协商 TLS 1.3 但失败(可能是由于密码)。我想看看我们是否可以将 k8s 探针配置为使用 TLS 1.2。或者,我们可以在服务器端关闭 TLS 1.3。在你的情况下,这是在 nginx 上。就我而言,我有一个带有 JDK 11.0.6 的 jetty 9.4 服务器。

另一种选择可能是升级 k8s。我们似乎在 k8s v1.15 集群中看到了这一点,但在 k8s v1.16.2 集群中没有看到。但我不确定这是由于 k8s 版本还是底层操作系统库(在我的情况下是 CentOS 7)。

关于nginx - livenessprobe 因 EOF 失败(nginx 容器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58383140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com