现象:Readiness probe failed 8181: connect: connection refused
1、分析:
kubectl 直接 describe CoreDNS Pod,显示 ReadinessProbe 探针异常,导致 Pod 无法正常启动,由于 ReadinessProbe 探针主要是确认 Pod 能否进入转发列表,也就是说 Pod 的 IP 和 Port 能否成为 Service 的 Endpoint 中的一个,如果 ReadinessProbe 探针失败,那么 Pod 就不会被加入到 Service 的 Endpoint 中,这样就会导致 Service 无法正常工作。我也对 CoreDNS 的 Service 也做了检查,发现 CoreDNS 的 Service 中的 Endpoint 为空,这就是为什么 Pod 之间无法相互调用的原因
2、解决方案
修改coredns 配置
kubectl edit cm/coredns -n kube-system,添加 ready:8181,并重启coredns 服务,即可恢复
- connection Readiness coredns connect refusedconnection readiness coredns refused err_connection_refused connection connect refused failed connection network refused ubuntu connection refused模式mac sockjs err_connection_refused 1685340190468 err_connection_refused connection refused网页 connection connect refused stable connection the localhost refused connectexception connection transport refused