1. 程式人生 > >使用kubernetes創建容器一直處於ContainerCreating狀態的原因查找與解決

使用kubernetes創建容器一直處於ContainerCreating狀態的原因查找與解決

ContainerCreating狀態

[root@k8s-master demo]# kubectl get pod

NAME READY STATUS RESTARTS AGE

busybox 0/1 ContainerCreating 0 12m


[root@k8s-master demo]# kubectl describe pod busybox

Name: busybox

Namespace: default

Node: k8s-node-1/10.0.0.12

Start Time: Thu, 07 Jun 2018 09:53:48 +0800

Labels: <none>

Status: Pending

IP:

Controllers: <none>

Containers:

busybox:

Container ID:

Image: 10.0.0.10:5000/busybox

Image ID:

Port:

Command:

sleep

3600

State: Waiting

Reason: ContainerCreating

Ready: False

Restart Count: 0

Volume Mounts: <none>

Environment Variables: <none>

Conditions:

Type Status

Initialized True

Ready False

PodScheduled True

No volumes.

QoS Class: BestEffort

Tolerations: <none>

Events:

FirstSeen LastSeen Count From SubObjectPath Type Reason Message

--------- -------- ----- ---- ------------- -------- ------ -------

15m 15m 1 {default-scheduler } Normal Scheduled Successfully assigned busybox to k8s-node-1

15m 22s 64 {kubelet k8s-node-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\""

15m 11s 8 {kubelet k8s-node-1} Warning FailedSync 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)"


看到registry.access.redhat.com/rhel7/pod-infrastructure:latest感覺很奇怪,我設置的倉庫是grc.io,為什麽去拉取這個鏡像,懷疑是不是什麽沒有安裝好。嘗試運行docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest,提示redhat-ca.crt: no such file or directory。ls查看改文件是個軟連接,鏈接目標是/etc/rhsm,查看沒有rhsm,嘗試安裝yum install *rhsm*,出現相關軟件,感覺比較符合,所以安裝查看產生了/etc/rhsm文件夾。

再次運行kubectl get pods

NAME READY STATUS RESTARTS AGE
redis-master-qhd12 1/1 Running 0 13m






使用kubernetes創建容器一直處於ContainerCreating狀態的原因查找與解決