解决kubernetes启动容器时,容器一直是ContainerCreating不能running

解决方法:试试通过手动下载

docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest

docker pull 是还是报错

     open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory

查看下redhat-ca.crt确实不存在,registry.access.redhat.com/rhel7/pod-infrastructure:latest默认是https下载。

最终解决方案:

 1.docker search pod-infrastructure

INDEX       NAME                                                DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/openshift/origin-pod                      The pod infrastructure image for OpenShift 3    8                    
docker.io   docker.io/davinkevin/podcast-server                 Container around the Podcast-Server Applic...   5                    
docker.io   docker.io/infrastructureascode/aws-cli              Containerized AWS CLI on alpine to avoid r...   4                    [OK]
docker.io   docker.io/newrelic/infrastructure                   Public image for New Relic Infrastructure.      3                    
docker.io   docker.io/infrastructureascode/uwsgi                uWSGI application server                        2                    [OK]
docker.io   docker.io/infrastructureascode/serf                 A tiny Docker image with HashiCorp Serf us...   1                    [OK]
docker.io   docker.io/mosquitood/k8s-rhel7-pod-infrastructure                                                   1                    
docker.io   docker.io/podigg/podigg-lc-hobbit                   A HOBBIT dataset generator wrapper for PoDiGG   1                    [OK]
docker.io   docker.io/tianyebj/pod-infrastructure               registry.access.redhat.com/rhel7/pod-infra...   1                    
docker.io   docker.io/w564791/pod-infrastructure                latest                                          1                    
docker.io   docker.io/infrastructureascode/hello-world          A tiny "Hello World" web server with a hea...   0                    [OK]

找到可用的进行pull到本地。

2.docker pull docker.io/tianyebj/pod-infrastructure

3.docker tag pod-infrastructure 10.0.2.11:5000/pod-infrastructure  

其中10.0.2.11是本机的IP,pull下来之后push到本机的私有仓库。

4.docker push 10.0.2.11:5000/pod-infrastructure

5. /etc/kubernetes/kubelet 

pod-infrastructure是在node的kubelet配置文件中定义的, 要更改每个node中/etc/kubernetes/kubelet中对应的

“KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest"

修改为:

"KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image= 10.0.2.11:5000/pod-infrastructure:latest "

更改之后需要重启kubelet服务。

7.重启

systemctl restart kube-apiserver
systemctl restart kube-controller-manager

systemctl restart kube-scheduler


systemctl restart kubelet

systemctl restart kube-proxy

8. kubectl get pods 查看之前的pods已经正常状态Running


猜你喜欢

转载自blog.csdn.net/qa1986nibuhao/article/details/80770951
今日推荐