Kubernetes部署项目报错ImagePullBackOff日志提示rpc error: code..http: server gave HTTP response to HTTPS client

在使用kubernetes集群时,用docker私库中的镜像创建Pod

使用命令kubectl get pods查看pod运行情况,发现pod的运行情况,STATUS的值为ImagePullBackoff
在这里插入图片描述
使用命令kubectl describe pod Pod名称查看Pod详细运行情况信息
在这里插入图片描述在Events这一项中,发现错误信息

Failed to pull image “192.168.153.139:5000/k8sdemo”: rpc error: code = Unknown desc = Error response from daemon: Get https://192.168.153.139:5000/v2/: http: server gave HTTP response to HTTPS client

在这里插入图片描述
这是因为使用了私有仓库的镜像,但是没有在docker的配置文件中配置私有仓库的信息
修改daemon.json文件
使用命令vi /etc/docker/daemon.json修改docker配置文件daemon.json
在文件中增加一项:

{"insecure-registries":["192.168.184.141:5000"]}

如果没有这个文件就新建一个,如果文件里原来有内容要用用逗号隔开两段配置,其中ip要换成私有仓库所在的服务器的ip

发布了169 篇原创文章 · 获赞 150 · 访问量 18万+

猜你喜欢

转载自blog.csdn.net/eagleuniversityeye/article/details/101481566