在kubernetes集群上部署Pod时Pod的状态一直为ContainerCreating 使用命令kubectl describe pod podname查看Pod信息,显示Failed create pod sandbox. 使用命令journalctl -u kubelet -f查看系统日志中有关kubelet的信息 发现错误原因为Error response from daemon: manifest for 10.108.224.173:5000/google_containers/pause-amd64.3.0:latest not found"
google_containers/pause-amd64.3.0是kubernetes部署容器时必须使用的一个镜像,但是这个镜像好像需要翻墙才能下载,由于没办法下载这个镜像所以kubernetes集群报错了,想办法下载这个镜像并把它上传到私有镜像仓库就能解决问题了
首先从阿里云镜像仓库下载该镜像
docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0
然后修改node节点的kubelet配置文件/etc/kubernetes/kubelet,给参数KUBELET_ARGS加上一条配置:
--pod_infra_container_image=registry.cn-hangzhou.aliyuncs.com/google-containers/
pause-amd64:3.0
pod_infra_container_image配置参数一定要和你刚pull下来的镜像的名称一致