昨天在阿里云国内云服务器上用 kubernetes 1.37.1 搭建集群,网络插件用的是 cilium,通过下面的命令安装
cilium install --version 1.20.1 \
--set ipam.mode=kubernetes \
--namespace kube-system \
--set bpf.masquerade=true \
--set kubeProxyReplacement=true
安装后 cilium 正常运行,但 coredns pod 因健康检查失败无法启动
spec.containers{coredns}: Liveness probe failed: Get "http://192.168.0.13:8080/health": dial tcp 192.168.0.13:8080: connect: connection refused
spec.containers{coredns}: Readiness probe failed: Get "http://192.168.0.13:8181/ready": dial tcp 192.168.0.13:8181: connect: connection refused
spec.containers{coredns}: Container image "registry-vpc.cn-hangzhou.aliyuncs.com/cnblogs-k8s/coredns:v1.14.6" already present on machine and can be accessed by the pod
spec.containers{coredns}: Container created
spec.containers{coredns}: Container coredns failed liveness probe, will be restarted
spec.containers{coredns}: Container started
请问如何解决这个问题?
终于解决了,竟然是 coredns 镜像的问题!
用的是 coredns:v1.14.6 镜像,通过 docker push 推送到私有镜像仓库,部署时从私有镜像仓库拉取。
后来改为用 nerdctl push 重新推送镜像,问题就解决了。