运行容器的时候,发现一直处于ContainerCreating状态,悲了个催,刚入手就遇到了点麻烦,下面来讲讲如何查找问题及解决的

运行容器命令:

[root@master- ~]# kubectl run my-alpine --image=alpine --replicas= ping www.baidu.com

查看pods状态

 [root@master- ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
my-alpine--knzcx / ContainerCreating 6m
my-alpine--lmvv5 / ContainerCreating 6m

一直处于ContainerCreating状态,开始查找原因
执行如下命令:

 [root@master- ~]# kubectl describe pod my-alpine
Name: my-alpine--knzcx
Namespace: default
Node: node-/192.168.10.150
Start Time: Sat, Nov :: +
Labels: pod-template-hash=,run=my-alpine
Status: Pending
IP:
Controllers: ReplicaSet/my-alpine-
Containers:
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:
Environment Variables:
Conditions:
Type Status
Ready False
No volumes.
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
7m 7m {default-scheduler } Normal Scheduled Successfully assigned my-alpine--knzcx to node-
6m 6m {kubelet node-} 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)" 4m 47s {kubelet node-} 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)" 4m 8s {kubelet node-} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause:2.0\"" Name: my-alpine--lmvv5
Namespace: default
Node: node-/192.168.10.150
Start Time: Sat, Nov :: +
Labels: pod-template-hash=,run=my-alpine
Status: Pending
IP:
Controllers: ReplicaSet/my-alpine-
Containers:
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:
Environment Variables:
Conditions:
Type Status
Ready False
No volumes.
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
7m 7m {default-scheduler } Normal Scheduled Successfully assigned my-alpine--lmvv5 to node-
5m 1m {kubelet node-} 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)" 3m 1m {kubelet node-} Warning FailedSync Error 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
有如下解决办法:

    1. 翻墙
    2. 修改hosts文件(这里我用的是“61.91.161.217  gcr.io”,但是可能会失效)
    3. 从其他源下载容器“pause:2.0”,然后打tag为“gcr.io/google_containers/pause:2.0”

使用kubernetes创建容器一直处于ContainerCreating状态的原因查找与解决的更多相关文章

  1. kubernetes创建yaml,pod服务一直处于 ContainerCreating状态的原因查找与解决

    最近刚刚入手研究kubernetes,运行容器的时候,发现一直处于ContainerCreating状态,悲了个催,刚入手就遇到了点麻烦,下面来讲讲如何查找问题及解决的 运行容器命令: kubectl ...

  2. 使用k8s创建容器一直处于ContainerCreating状态

    容器报错信息为(两种): FailedSynError syncing pod, skipping: failed to {kubelet 127.0.0.1} Warning FailedSync ...

  3. CentOS 7 yum安装 k8s 创建Pod一直处于ContainerCreating状态 问题解决

    问题描述 使用CentOS7的 yum 包管理器安装了 Kubernetes 集群,使用 kubectl 创建服务成功后,执行 kubectl get pods,发现AGE虽然在不断增加,但状态始终不 ...

  4. 解决k8s出现pod服务一直处于ContainerCreating状态的问题的过程

    参考于: https://blog.csdn.net/learner198461/article/details/78036854 https://liyang.pro/solve-k8s-pod-c ...

  5. kubernetes删除pod一直处于terminating状态的解决方法

    kubernetes删除pod一直处理 Terminating状态 # kubectl get po -n mon NAME READY STATUS RESTARTS AGE alertmanage ...

  6. 点击ViewGroup时其子控件也变成pressed状态的原因分析及解决办法

    这个问题,当初在分析touch事件处理的时候按理应该分析到的,可是由于我当时觉得这块代码和touch的主题不是那么紧密, 就这么忽略掉了,直到后来在这上面遇到了问题.其实这个现象做Android开发的 ...

  7. Docker 创建容器 查看容器状态 - 三

    Docker 创建容器 1.拉取镜像 默认是 docker.io 仓最新镜像 docker pull tomcat 2.运行一个服务容器 docker run -d -p 0.0.0.0:18080: ...

  8. Kubernetes创建挂载共享存储的容器

    原文链接:https://www.58jb.com/html/135.html 在上一次的Mysql容器中,已经使用过了配置宿主机目录挂载的方式,这样虽然方便但是不够安全:一般都是把数据存储在远程服务 ...

  9. kubernetes删除pod,pod一直处于Terminating状态

    删除pod,pod一直处于Terminating状态 [root@yxz-cluster01 deploy_yaml]# kubectl get pod -n yunanbao NAME READY ...

随机推荐

  1. 【javaw.exe 两个】启动了两个javaw.exe 相关

    大家开发 肯定见过 两条并存的现象吧! 关闭方式1: 在任务管理器中,挑选 内存占用较小的 那个  关闭即可!! 关闭方式2: 1.查找对应的端口占用的进程:netstat  -aon|findstr ...

  2. 斯坦福大学卷积神经网络教程UFLDL Tutorial - Convolutional Neural Network

    Convolutional Neural Network Overview A Convolutional Neural Network (CNN) is comprised of one or mo ...

  3. ChartView与LineSeries搭配实现曲线局部缩放功能

    效果图: 上一篇文章实现的时候还不知道有QtChart这个模块......好好看了下资料就想做个例子实现一下这功能,比较了下代码量...恩,直接看代码: Rectangle { id: view_re ...

  4. Redis安装、主从配置及aof使用

    找了02,03,04三台机器,04做主,02做从,03做客户端. 都使用jumbo install redis安装了Redis(server+client). 在 02 从的 ~/.jumbo/etc ...

  5. 基于cookie或session的登陆验证之安全性问题

    因为session是关了浏览器就没了.所以可以通过cookie结合session方法来做验证! 第一次登陆,生成一个cookie,保存一些加密的帐号信息,然后再生成一个session 这样去其他需要验 ...

  6. jquery ajax 获取 json 文件数据

    [ {"name":"project1"}, {"name":"project2"}, {"name" ...

  7. 小课堂week19 编程范式巡礼最终季 超级范式

    编程范式巡礼(最终季)--超级范式 本周是编程范式系列的最后一次分享,让我们拉长视角,看向远方,进入"元编程"的领域,在<冒号课堂>中起了个很酷的名字:"超级 ...

  8. 如何使用Linux匿名上网-四大法宝

    信息时代给我们的生活带来极大便利和好处的同时也带来了很大的风险.一方面,人们只要点击几下按钮,就能基本上访问已知存在的全部信息和知识;另一方面,要是这种权力落到个别不法分子手里,就会引起重大破坏和灾难 ...

  9. 使用微软提供的Office Online实现Office文档的在线查看,编辑等功能

    使用微软提供的Office Online平台只需要一个网址即可在线查看Xls,doc,PPT等文档 http://view.officeapps.live.com/op/view.aspx?src=要 ...

  10. MyReport报表引擎2.1.0.1新功能

    MyReport报表引擎(免Flex开发集成版)的使用场合适用于以传统html构建的系统,希望集成MyReport报表引擎的报表预览.打印和报表设计功能,而且不须要进行Flex相关的二次开发的用户.M ...