欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

k8s pod状态 ImagePullBackOff

程序员文章站 2022-03-12 10:19:36
...
[[email protected] hadoop]#  kubectl get pods -o wide -n test
NAME                     READY   STATUS             RESTARTS   AGE   IP           NODE       NOMINATED NODE   READINESS GATES
nginx                    0/1     ImagePullBackOff   0          14m   10.244.1.4   hadoop02   <none>           <none>
nginx-5984cd8d48-rx4mz   0/1     ImagePullBackOff   0          10m   10.244.1.5   hadoop02   <none>           <none>

k8s pod状态 ImagePullBackOff

我是在本地build的镜像,也没有构建本地镜像仓库(以为本地存在镜像就会从本地读取);后发现是从镜像仓库拉取才可以…

[[email protected] k8s]# docker pull registry
...

[[email protected] k8s]# docker run -d -v /registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:lastest

############
[[email protected] k8s]# cat /etc/docker/daemon.json
{
        "registry-mirrors": ["https://registry.docker-cn.com"],
        "storage-driver": "devicemapper",
        "exec-opts": ["native.cgroupdriver=systemd"],
        "insecure-registries": ["hadoop03:5000"]
}

[[email protected] k8s]# docker push hadoop03:5000/nginx

################
[[email protected] k8s]# curl hadoop03:5000/v2/_catalog
{"repositories":["nginx"]}
相关标签: K8S kubernetes