使用kubernetes创建容器一直处于ContainerCreating状态的原因查找与解决
2017-02-05 13:34
531 查看
运行容器的时候,发现一直处于ContainerCreating状态,悲了个催,刚入手就遇到了点麻烦,下面来讲讲如何查找问题及解决的
运行容器命令:
View Code
不难看出,无法访问到gcr.io
有如下解决办法:
FQ
修改hosts文件(这里我用的是“61.91.161.217 gcr.io”,但是可能会失效)
从其他源下载容器“pause:2.0”,然后打tag为“gcr.io/google_containers/pause:2.0”
运行容器命令:
1 [root@master-149 ~]# kubectl describe pod my-alpine 2 Name: my-alpine-2150523991-knzcx 3 Namespace: default 4 Node: node-150/192.168.10.150 5 Start Time: Sat, 19 Nov 2016 18:20:52 +0800 6 Labels: pod-template-hash=2150523991,run=my-alpine 7 Status: Pending 8 IP: 9 Controllers: ReplicaSet/my-alpine-2150523991 10 Containers: 11 my-alpine: 12 Container ID: 13 Image: alpine 14 Image ID: 15 Port: 16 Args: 17 ping 18 www.baidu.com 19 QoS Tier: 20 cpu: BestEffort 21 memory: BestEffort 22 State: Waiting 23 Reason: ContainerCreating 24 Ready: False 25 Restart Count: 0 26 Environment Variables: 27 Conditions: 28 Type Status 29 Ready False 30 No volumes. 31 Events: 32 FirstSeen LastSeen Count From SubobjectPath Type Reason Message 33 --------- -------- ----- ---- ------------- -------- ------ ------- 34 7m 7m 1 {default-scheduler } Normal Scheduled Successfully assigned my-alpine-2150523991-knzcx to node-150 35 6m 6m 1 {kubelet node-150} 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 be because there are no credentials on 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/_ping: dial tcp 64.233.189.82:443: getsockopt: connection refused)" 36 37 4m 47s 3 {kubelet node-150} 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 be because there are no credentials on 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/_ping: dial tcp 74.125.204.82:443: getsockopt: connection refused)" 38 39 4m 8s 6 {kubelet node-150} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause:2.0\"" 40 41 42 Name: my-alpine-2150523991-lmvv5 43 Namespace: default 44 Node: node-150/192.168.10.150 45 Start Time: Sat, 19 Nov 2016 18:20:52 +0800 46 Labels: pod-template-hash=2150523991,run=my-alpine 47 Status: Pending 48 IP: 49 Controllers: ReplicaSet/my-alpine-2150523991 50 Containers: 51 my-alpine: 52 Container ID: 53 Image: alpine 54 Image ID: 55 Port: 56 Args: 57 ping 58 www.baidu.com 59 QoS Tier: 60 cpu: BestEffort 61 memory: BestEffort 62 State: Waiting 63 Reason: ContainerCreating 64 Ready: False 65 Restart Count: 0 66 Environment Variables: 67 Conditions: 68 Type Status 69 Ready False 70 No volumes. 71 Events: 72 FirstSeen LastSeen Count From SubobjectPath Type Reason Message 73 --------- -------- ----- ---- ------------- -------- ------ ------- 74 7m 7m 1 {default-scheduler } Normal Scheduled Successfully assigned my-alpine-2150523991-lmvv5 to node-150 75 5m 1m 3 {kubelet node-150} 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 be because there are no credentials on 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/_ping: dial tcp 74.125.204.82:443: getsockopt: connection refused)" 76 77 3m 1m 4 {kubelet node-150} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause:2.0\"" 78 其中: 79 80 Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for gcr.io/google_containers/pause:2.0, this may be because there are no credentials on 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/_ping: dial tcp 74.125.204.82:443: getsockopt: connection refused)
View Code
不难看出,无法访问到gcr.io
有如下解决办法:
FQ
修改hosts文件(这里我用的是“61.91.161.217 gcr.io”,但是可能会失效)
从其他源下载容器“pause:2.0”,然后打tag为“gcr.io/google_containers/pause:2.0”
相关文章推荐
- 使用kubernetes创建容器一直处于ContainerCreating状态的原因查找与解决
- kubernetes创建yaml,pod服务一直处于 ContainerCreating状态的原因查找与解决
- kubernetes创建yaml,pod服务一直处于 ContainerCreating状态的原因查找与解决
- kubernetes创建yaml,pod服务一直处于 ContainerCreating状态的原因查找与解决
- Kubernetes创建pod一直处于ContainerCreating排查和解决
- Android Studio创建新项目一直处于building状态的解决方法
- Hadoop一直处于初始化状态(引起原因不详,但问题解决)
- 解决magento新闻邮件发送一直处于“正在发送”状态问题
- magento新闻邮件发送一直处于“正在发送”状态问题解决
- eclipse 里的tomcat一直处于starting状态【已解决】
- AndroidStudio创建项目时一直处于building“project name”gradle project info的解决办法
- 处于CLOSE_WAIT和TIME_WAIT状态连接的原因及解决
- magento新闻邮件发送一直处于“正在发送”状态问题解决
- IOS已解决 在构建版本上传后, 一直处于处理状态
- 使用aforge的AVIWriter打开或创建文件异常Failed creating compressed stream的解决办法
- Mysql/MariaDB启动时处于进度条状态导致启动失败的原因及解决办法
- android Eclipse is loading the SDK ,SDK一直处于Loading状态解决办法
- [SharePoint 2007]如何解决上传InfoPath表单时一直处于正在安装状态的问题
- 如何解决User Profile Synchronization Service一直处于“正在启动”状态
- Android Studio在创建项目是一直处于building “project name”gradle project info的解决办法