kubernetes启动pod,pod状态一直不正常

kubernetes启动pod,pod状态一直不正常,查看pod状态显示

  image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request.  details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)

按照网上所说的解决方案:yum install *rhsm* -y

 Failed to create pod infra container: ImagePullBackOff; Skipping pod "redis-master-jj6jw_default(fec25a87-cdbe-11e7-ba32-525400cae48b)": Back-off pulling image "registry.access.redhat.com/rhel7/pod-infrastructure:latest  

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

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.vi /etc/kubernetes/kubelet 

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

6.重启

  systemctl restart kube-apiserver
systemctl restart kube-controller-manager
systemctl restart kube-scheduler
systemctl restart kubelet

systemctl restart kube-proxy

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值