运行容器的时候,发现一直处于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. matlab colormap

    This table lists the built-in colormaps functions. Colormap Name Color Scale parula

  2. cocos2d-x HelloWorld 代码一撇

        本节简单对新生成的hellowrold 项目相关代码进行简单分析,具体以代码注释的方式展示给大家.代码相对简单些,在此不作过多赘述,直接上码: int APIENTRY _tWinMain(H ...

  3. [转]Hamcrest使用方法实例

    assertThat方法需要使用hamcrest的匹配方法: 示例 assertThat( n, allOf( greaterThan(1), lessThan(15) ) ); assertThat ...

  4. iOS:网络编程的第三方框架:AFNetworking、SDWebImage

    网络编程第三方框架:AFNetworking.SDWebImage 介绍:这些框架是开源的,经过前人的封装.改进,成为使用次数很多的一个性能好的源代码框架,只需要将它导入项目中,就可以使用.因此,在做 ...

  5. OpenCV学习(6) 文件和Mat之间的数据交换

          有时候为了便于调试算法,我们需要从文本文件或二进制文件中读取数据,并把数据放到相应的矩阵中去.我们通常可以通过下面的函数实现.   1.从二进制文件中读取数据.      新建一个txt文 ...

  6. iOS公布app到App Store教程

    要公布首先须要公布证书,其获取和安装的基本流程和真机调试证书一致,关于真机调试证书的获取和使用能够參考这篇文章.只是如今Xcode7不须要真机调试证书也可实现真机调试了.能够參考这篇文章. 要获取证书 ...

  7. (转)scala中map与flatMap浅析

    在函数式语言中,函数作为一等公民,可以在任何地方定义,在函数内或函数外,可以作为函数的参数和返回值,可以对函数进行组合.由于命令式编程语言也可以通过类似函数指针的方式来实现高阶函数,函数式的最主要的好 ...

  8. C#应用视频教程1.3 Socket通信客户端完善

    我们先把前面的代码封装成一个完整的类,因为跟网络相关的方法并不一定是建立socket的服务器和客户端,所以还是应该把两个分开,比如获取本机IP,修改本机IP,PING远程主机这些事情应该放在一个单独的 ...

  9. UVA 270 Lining Up (几何 判断共线点)

     Lining Up  ``How am I ever going to solve this problem?" said the pilot. Indeed, the pilot was ...

  10. 算法笔记_133:最大连续乘积子数组(Java)

    目录 1 问题描述 2 解决方案 2.1 蛮力法 2.2 动态规划法   1 问题描述 给定一个浮点数组,任意取出数组中的若干个连续的数相乘,请找出其中乘积最大的子数组. 2 解决方案 2.1 蛮力法 ...