使用k8s建立容器一直處於ContainerCreating狀態

容器報錯信息爲(兩種):python

FailedSynError syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "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)" 13m 11s 56 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"registry.access.redhat.com/rhel7/pod-infrastructure:latest\""

Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "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)"

大體意思就是:未能經過ErrImagePull爲「POD」啓動「StartContainer」:「對於registry.access.redhat.com/rhel7/pod-infrastructure:latest,圖像拉出失敗,這多是由於此請求上沒有證書 docker

檢查發現:/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt這個目錄中是一個軟鏈接centos

發現實際上並無這個文件:工具

其實在個人k8s編排工具使用文檔中我提過這個錯誤,說是由於證書致使的, 而後下載一個  yum remove *rhsm* -y  就能夠解決,可是我最近溫習一遍後發現這個rhsm文件被調換了,下載後發現是空的,而後找方法解決。this

 

解決方法:下載rpm包安裝spa

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem

  註釋:rpm2cpio命令用於將rpm軟件包轉換爲cpio格式的文件3d

       cpio命令主要是用來創建或者還原備份檔的工具程序,cpio命令能夠複製文件到歸檔包中,或者從歸檔包中複製文件。          code

           -i   還原備份檔  blog

           -v  詳細顯示指令的執行過程ip

最後解決了!

相關文章
相關標籤/搜索