使用kubernetes创建容器一直处于ContainerCreating状态的原因查找与解决
来源:互联网 发布:年老才知陪伴 编辑:程序博客网 时间:2024/05/03 07:04
最近刚刚入手研究kubernetes,运行容器的时候,发现一直处于ContainerCreating状态,悲了个催,刚入手就遇到了点麻烦,下面来讲讲如何查找问题及解决的
运行容器命令:
[root@master-149 ~]# kubectl run my-alpine --image=alpine --replicas=2 ping www.baidu.com
查看pods状态
[root@master-149 ~]# kubectl get podsNAME READY STATUS RESTARTS AGEmy-alpine-2150523991-knzcx 0/1 ContainerCreating 0 6mmy-alpine-2150523991-lmvv5 0/1 ContainerCreating 0 6m
一直处于ContainerCreating状态,开始查找原因
执行如下命令:
[root@master-149 ~]# kubectl describe pod my-alpineName:my-alpine-2150523991-knzcxNamespace:defaultNode:node-150/192.168.10.150Start Time:Sat, 19 Nov 2016 18:20:52 +0800Labels:pod-template-hash=2150523991,run=my-alpineStatus:PendingIP:Controllers:ReplicaSet/my-alpine-2150523991Containers: my-alpine: Container ID: Image:alpine Image ID: Port: Args: ping www.baidu.com QoS Tier: cpu:BestEffort memory:BestEffort State:Waiting Reason:ContainerCreating Ready:False Restart Count:0 Environment Variables:Conditions: TypeStatus Ready False No volumes.Events: FirstSeenLastSeenCountFromSubobjectPathTypeReasonMessage ------------------------------------------------------------ 7m7m1{default-scheduler }NormalScheduledSuccessfully assigned my-alpine-2150523991-knzcx to node-150 6m6m1{kubelet node-150}WarningFailedSyncError 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)" 4m47s3{kubelet node-150}WarningFailedSyncError 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)" 4m8s6{kubelet node-150}WarningFailedSyncError syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause:2.0\""Name:my-alpine-2150523991-lmvv5Namespace:defaultNode:node-150/192.168.10.150Start Time:Sat, 19 Nov 2016 18:20:52 +0800Labels:pod-template-hash=2150523991,run=my-alpineStatus:PendingIP:Controllers:ReplicaSet/my-alpine-2150523991Containers: my-alpine: Container ID: Image:alpine Image ID: Port: Args: ping www.baidu.com QoS Tier: cpu:BestEffort memory:BestEffort State:Waiting Reason:ContainerCreating Ready:False Restart Count:0 Environment Variables:Conditions: TypeStatus Ready False No volumes.Events: FirstSeenLastSeenCountFromSubobjectPathTypeReasonMessage ------------------------------------------------------------ 7m7m1{default-scheduler }NormalScheduledSuccessfully assigned my-alpine-2150523991-lmvv5 to node-150 5m1m3{kubelet node-150}WarningFailedSyncError 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)" 3m1m4{kubelet node-150}WarningFailedSyncError syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause:2.0\""
其中:
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)
不难看出,无法访问到gcr.io
有如下解决办法:
- 翻墙
- 修改hosts文件(这里我用的是“61.91.161.217 gcr.io”,但是可能会失效)
- 从其他源下载容器“pause:2.0”,然后打tag为“gcr.io/google_containers/pause:2.0”
1 0
- 使用kubernetes创建容器一直处于ContainerCreating状态的原因查找与解决
- kubernetes创建yaml,pod服务一直处于 ContainerCreating状态的原因查找与解决
- kubernetes创建yaml,pod服务一直处于 ContainerCreating状态的原因查找与解决
- arcgis一直处于初始化状态的原因
- 定位“kubernetes pod卡在ContainerCreating状态”问题的方法
- eclipse 里的tomcat一直处于starting状态【已解决】
- DWR一直处于加载状态的问题解决
- tomcat启动一直处于starting的状态
- [SharePoint 2007]如何解决上传InfoPath表单时一直处于正在安装状态的问题
- InteliJ idea创建maven项目时一直处于loading状态
- 如何 解决 word2013 启动后 文档一直处于最小化状态?
- Android Studio 创建/打开项目时一直处于 Building“project name”Gradle project info 的解决
- Android Studio 创建/打开项目时一直处于Building“project name”Gradle project info 的解决
- tomcat一直处于deploying状态。
- 如何让自己的工作状态一直处于饱满??
- Galaxy Nexus I9250一直处于充电状态的解决办法
- thinkpad alert键一直处于按着的状态
- Android Studio一直处于Refreshing状态的解决方法
- js延迟加载的几种方法
- Bootstrap Modal遮罩弹出层
- iOS和Android推送功能总结
- 华为主推的Polar Code提案内容
- android自定义控件的自定义属性
- 使用kubernetes创建容器一直处于ContainerCreating状态的原因查找与解决
- 交付自动化的探索与展望
- Linux的概念与体系
- Ajax 是什么? 如何创建一个Ajax?
- @Repository、@Service、@Controller 和 @Component
- CentOS修改主机名方法大全
- 京东商城总架构师、基础平台负责人刘海锋:京东双11创新技术实践
- java.sql.SQLException: !Statement.GeneratedKeysNotRequested!
- Maven 多模块以及单模块生成Javadoc配置,同时识别基础markdown语法