目录

  • 背景
  • 解决方案

背景

  • 新创建的nginx-deployment,情况如下所示。
[root@localhost software]# kubectl get pods
NAME                              READY     STATUS              RESTARTS   AGE
nginx-deployment-94093859-51185   0/1       ContainerCreating   0          11m
nginx-deployment-94093859-8744s   0/1       ContainerCreating   0          11m
nginx-deployment-94093859-zvbb1   0/1       ContainerCreating   0          11m
  • 状态一直是ContainerCreating ,READY0/1

解决方案

  • 查看pod详情,使用命令 kubectl describe pod nginx-deployment-94093859-51185nginx-deployment-94093859-51185是我pod名称)。
[root@localhost software]# kubectl describe pod nginx-deployment-94093859-51185
Name:       nginx-deployment-94093859-51185
Namespace:  default
Node:       127.0.0.1/127.0.0.1
Start Time: Sat, 26 Jun 2021 21:30:06 -0400
Labels:     app=nginxpod-template-hash=94093859track=stable
Status:     Pending
IP:
Controllers:    ReplicaSet/nginx-deployment-94093859
Containers:nginx:Container ID:  Image:      nginx:1.7.9Image ID:        Port:       80/TCPState:        WaitingReason:      ContainerCreatingReady:     FalseRestart Count: 0Volume Mounts:/var/run/secrets/kubernetes.io/serviceaccount from default-token-k3tq8 (ro)Environment Variables:    <none>
Conditions:Type     StatusInitialized   True Ready  False PodScheduled  True
Volumes:default-token-k3tq8:Type:   Secret (a volume populated by a Secret)SecretName:  default-token-k3tq8
QoS Class:  BestEffort
Tolerations:    <none>
Events:FirstSeen    LastSeen    Count   From            SubObjectPath   Type        Reason      Message---------    --------    -----   ----            -------------   --------    ------      -------12m      12m     1   {default-scheduler }            Normal      Scheduled   Successfully assigned nginx-deployment-94093859-51185 to 127.0.0.112m       1m      7   {kubelet 127.0.0.1}         Warning     FailedSync  Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request.  details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)"11m    7s  50  {kubelet 127.0.0.1}     Warning FailedSync  Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"registry.access.redhat.com/rhel7/pod-infrastructure:latest\""

有一个错误"image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request. details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)"

  • 查看/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt后发现是个软链接。
  • 并且没有 /etc/rhsm/ca/redhat-uep.pem文件。
  • 尝试直接docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest也拉不下来,也会报找不到文件。
  • 只要我们能生成/etc/rhsm/ca/redhat-uep.pem文件,问题也就迎刃而解了。
  • 有的人用yum install *rhsm*解决了问题,但是在我的电脑上不行,所以下面是另一个方案。
    • 1、下载python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm文件

       wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
      
    • 2、生成/etc/rhsm/ca/redhat-uep.pem文件

         rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem
      
  • 再次拉取registry.access.redhat.com/rhel7/pod-infrastructure:latest,执行命令 docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest
  • 再次查看pod状态,已经正常了,如下图所示。
  • docker进程运行状态如下所示。

kubernetes pod一直是ContainerCreating,READY是0/1相关推荐

  1. K8S (kubernetes)pod服务 Status 处于 Containercreating,Ready处于0/1 的问题解决

    运行命令 kubectl get pod pod的status是ContainerCreating,Ready处于0/1 [root@localhost ca]# kubectl get pod NA ...

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

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

  3. 支持纳管Redis数据库,支持查看、连接和会话审计Kubernetes Pod,JumpServer堡垒机v2.18.0发布

    2022年1月24日,JumpServer开源堡垒机正式发布v2.18.0版本.在这一版本中,JumpServer新增支持纳管Redis数据库,支持查看.连接.操作和会话审计Kubernetes Po ...

  4. 八、kubernetes Pod控制器

    Pod 控制器 文章目录 Pod 控制器 1. ReplicaSet(RS) 2. Deployment(Deploy) 3. Horizontal Pod Autoscaler(HPA) 4. Da ...

  5. 由于docker pull image失败,导致k8s pod卡在ContainerCreating状态

    由于国内有一些公有云的服务器,访问docker.io非常不稳定, 导致pull image一直是失败的, nginx.yaml # cat nginx.yaml apiVersion: v1 kind ...

  6. 容器编排技术 -- Kubernetes Pod 生命周期

    容器编排技术 -- Kubernetes Pod 生命周期 1 Pod phase 2 Pod 状态 3 容器探针 3.1 该什么时候使用存活(liveness)和就绪(readiness)探针? 4 ...

  7. 浅析Kubernetes Pod重启策略和健康检查

    使用Kubernetes的主要好处之一是它具有管理和维护集群中容器的能力,几乎可以提供服务零停机时间的保障.在创建一个Pod资源后,Kubernetes会为它选择worker节点,然后将其调度到节点上 ...

  8. kubernetes Pod Lifecycle生命周期与livenessProbe、 readinessProbe探测方法

    kuberenetes pod Liveness, Readiness and Startup Probes tags: Pod,探针,健康检测 文章目录 kuberenetes pod Livene ...

  9. Kubernetes pod 状态出现 ImagePullBackOff 的原因

    通过一个试验作为例子来学习一下. 我们创建一个名为fail 的 deployment,让它故意指向一个实际并不存在的 Docker 镜像: $ kubectl run fail --image=jer ...

最新文章

  1. 递归下降文法C语言实验报告,递归下降语法分析器实验报告.doc
  2. 关于Beta分布、二项分布与Dirichlet分布、多项分布的关系
  3. 不需要密码的windows计划任务设置
  4. seir模型数学建模python_Python改进的SEIR模型
  5. 设计一款编程语言有多难?Ruby 创始人揭秘
  6. cad缺失字体补全工具_CAD图纸字体不全怎么办?只要修改字体映射表就可以轻松解决了...
  7. 1600k 打印头测试软件,巧修 LQ-1600K打印头.doc
  8. 线性代数系列(八)--线性代数和图论
  9. java的一些学习网址。。。。。
  10. linux ipcs字段含义 共享内存删除 ipcs dest状态
  11. 稳压器功能一览[转]
  12. 如何破解加密ppt文档的密码
  13. 在服务器上部署自己的h5页面用于微信内部浏览器打开
  14. 如何解决Java查看源代码时页面显示Source not found
  15. python3中的urllib.parse的常用方法
  16. 【店小蜜】欢迎语卡片的设置和测试
  17. 一步一步来制作CSS3 3D旋转相册
  18. Paper reading
  19. 一个测试菜鸟如何成长为测试开发专家
  20. 安装Solidworks出现报错:可执行文件VCRedist10\vcredist_x64.exe未成功安装/ 找不到vc_red.msi文件路径/ Windows不允许更新经过管理的播发产品

热门文章

  1. Micheal Nielsen's神经网络学习之三:过拟合与规范化
  2. 供应链管理的五大策略
  3. JAVA中用POI操作word
  4. 基于微信小程序云开发(校园许愿墙app)2.0稳定版,以发布上线
  5. cc2650 7x7封装更换为 5X5 4x4
  6. 百度年龄计算机在线使用,百度精准年龄计算器在线计算app
  7. ClientDisconnectionReason(客户端断开原因)_羊豆豆_新浪博客
  8. linux服务器关机日期,linux服务器last查看关机记录
  9. 由浅入深!全面了解Kafka 生产者解析,赶紧拿下
  10. python中int函数的功能_python中int函数的用法