Run the container, the discovery has been in the containercreating state, sad a reminder, just started to encounter a bit of trouble, the following talk about how to find problems and solve
To run the container command:
[[email protected]149 ~]# kubectl run my-alpine--image=alpine--replicas=2Ping Www.baidu.com
View Code
View Pods Status
1 [[email protected]149 ~]# kubectl Get pods2NAME ready STATUS Restarts age3 my-alpine-2150523991-knzcx 0/1 Containercreating 0 6m4 my-alpine-2150523991-lmvv5 0/1 containercreating 0 6m
View Code
Always in containercreating state, start looking for reasons
Execute the following command:
1[[Email protected]149~]# Kubectl describe pod my-Alpine2name:my-alpine-2150523991-knzcx3 Namespace:default4node:node- Max/192.168.10.1505Start Time:sat, +Nov . -: -: the+08006Labels:pod-template-hash=2150523991, run=my-Alpine7 status:pending8 IP:9controllers:replicaset/my-alpine-2150523991Ten Containers: Onemy-Alpine: A Container ID: - Image:alpine - Image ID: the Port: - Args: - Ping - www.baidu.com + QoS Tier: - Cpu:besteffort + Memory:besteffort A state:waiting at reason:containercreating - Ready:false -Restart Count:0 - Environment Variables: - Conditions: - Type Status in Ready False - No volumes. to Events: + firstseen lastseen Count from Subobjectpath Type Reason Message ---------- -------- ----- ---- ------------- -------- ------ ------- the7m 7m1{Default-scheduler} Normal scheduled successfully assigned my-alpine-2150523991-knzcx to node- Max *6m 6m1{Kubelet node- Max} Warning Failedsync Error syncing pod, skipping:failed to"Startcontainer" for "POD"With Errimagepull:"image pull failed for gcr.io/google_containers/pause:2.0, this may because there is no credentials on the this request . Details: (Unable to ping registry endpoint Https://gcr.io/v0/\nv2 Ping attempt failed with Error:get https://gcr.io/v2/: Dial TCP 64.233.189.82:443:getsockopt:connection refused\n v1 ping attempt failed with Error:get Https://gcr.io/v1/_pin G:dial TCP 64.233.189.82:443:getsockopt:connection refused)" $ Panax Notoginseng4m 47s3{Kubelet node- Max} Warning Failedsync Error syncing pod, skipping:failed to"Startcontainer" for "POD"With Errimagepull:"image pull failed for gcr.io/google_containers/pause:2.0, this may because there is no credentials on the this request . Details: (Unable to ping registry endpoint Https://gcr.io/v0/\nv2 Ping attempt failed with Error:get https://gcr.io/v2/: Dial TCP 74.125.204.82:443:getsockopt:connection refused\n v1 ping attempt failed with Error:get Https://gcr.io/v1/_pin G:dial TCP 74.125.204.82:443:getsockopt:connection refused)" - the4m 8s6{Kubelet node- Max} Warning Failedsync Error syncing pod, skipping:failed to"Startcontainer" for "POD"With Imagepullbackoff:"Back-off pulling image \ "Gcr.io/google_containers/pause:2.0\"" + A thename:my-alpine-2150523991-lmvv5 + Namespace:default -node:node- Max/192.168.10.150 $Start Time:sat, +Nov . -: -: the+0800 $Labels:pod-template-hash=2150523991, run=my-Alpine - status:pending - IP: thecontrollers:replicaset/my-alpine-2150523991 - Containers:Wuyimy-Alpine: the Container ID: - Image:alpine Wu Image ID: - Port: About Args: $ Ping - www.baidu.com - QoS Tier: - Cpu:besteffort A Memory:besteffort + state:waiting the reason:containercreating - Ready:false $Restart Count:0 the Environment Variables: the Conditions: the Type Status the Ready False - No volumes. in Events: the firstseen lastseen Count from Subobjectpath Type Reason Message the--------- -------- ----- ---- ------------- -------- ------ ------- About7m 7m1{Default-scheduler} Normal scheduled successfully assigned my-alpine-2150523991-LMVV5 to node- Max the5m 1m3{Kubelet node- Max} Warning Failedsync Error syncing pod, skipping:failed to"Startcontainer" for "POD"With Errimagepull:"image pull failed for gcr.io/google_containers/pause:2.0, this may because there is no credentials on the this request . Details: (Unable to ping registry endpoint Https://gcr.io/v0/\nv2 Ping attempt failed with Error:get https://gcr.io/v2/: Dial TCP 74.125.204.82:443:getsockopt:connection refused\n v1 ping attempt failed with Error:get Https://gcr.io/v1/_pin G:dial TCP 74.125.204.82:443:getsockopt:connection refused)" the the3m 1m4{Kubelet node- Max} Warning Failedsync Error syncing pod, skipping:failed to"Startcontainer" for "POD"With Imagepullbackoff:"Back-off pulling image \ "Gcr.io/google_containers/pause:2.0\"" + among them: - theError syncing pod, skipping:failed to"Startcontainer" for "POD"With Errimagepull:"image pull failed for gcr.io/google_containers/pause:2.0, this may because there is no credentials on the this request . Details: (Unable to ping registry endpoint Https://gcr.io/v0/\nv2 Ping attempt failed with Error:get https://gcr.io/v2/: Dial TCP 74.125.204.82:443:getsockopt:connection refused\n v1 ping attempt failed with Error:get Https://gcr.io/v1/_pin G:dial TCP 74.125.204.82:443:getsockopt:connection refused)
View Code
Not hard to see, unable to access to Gcr.io
The following solutions are available:
- FQ
- Modify the Hosts file (I'm using "61.91.161.217 Gcr.io" here, but it may fail)
- Download the container "pause:2.0" from other sources, and then hit tag "gcr.io/google_containers/pause:2.0"
Use Kubernetes to create a container that has been in the containercreating state for reasons of finding and resolving