【发布时间】:2020-09-15 15:13:27
【问题描述】:
当我尝试为我的 awx_web 容器设置 liveness & readiness prob 时,我不断收到此错误
Liveness probe failed: Get http://POD_IP:8052/: dial tcp POD_IP:8052: connect: connection refused
我的容器 awx_web 部署中的 Liveness & Readiness 部分
ports:
- name: http
containerPort: 8052 # the port of the container awx_web
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 8052
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
httpGet:
path: /
port: 8052
initialDelaySeconds: 5
periodSeconds: 5
如果我测试端口 8052 是否从与包含容器 awx_web 的 pod 位于同一名称空间的另一个 pod 中打开,或者如果我使用与容器 awx_web 部署在同一 pod 中的容器进行测试,我会得到这个(端口已打开)
/ # nc -vz POD_IP 8052
POD_IP (POD_IP :8052) open
如果我从部署包含容器 awx_web 的 pod 的工作节点使用 netcat (nc),我会得到相同的结果(端口 8052 已打开)。
对于信息,我使用 NodePort 服务将流量重定向到该容器 (awx_web)
type: NodePort
ports:
- name: http
port: 80
targetPort: 8052
nodePort: 30100
【问题讨论】:
-
如果您从另一个 pod 执行
curl http://POD_IP:8052/..它有效吗? -
来自另一个 pod、同一个 pod 中的容器或工作节点,是的,它可以工作
-
检查 kubelet 和 cni 插件 pod 日志
-
对于 kubelet 日志,它给出了同样的错误
标签: http kubernetes ansible-awx readinessprobe livenesprobe