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

1 问题详情

创建nginx

kubectl run nginx --image=nginx --replicas=2 --port=80

发现一直处于ContainerCreating

kubectl -s 'http://127.0.0.1:8099' get pods
NAME                    READY     STATUS              RESTARTS   AGE
nginx-203864630-6rfgg   0/1       ContainerCreating   0          11m
nginx-203864630-zvgpt   0/1       ContainerCreating   0          11m

查看容器状态

kubectl -s 'http://127.0.0.1:8099' describe pod nginx-203864630-6rfgg

Name:           nginx-203864630-6rfgg
Namespace:      default
Node:           127.0.0.1/127.0.0.1
Start Time:     Thu, 18 Jun 2020 16:30:44 +0800
Labels:         pod-template-hash=203864630
                run=nginx
Status:         Pending
IP:
Controllers:    ReplicaSet/nginx-203864630
Containers:
  nginx:
    Container ID:
    Image:                      nginx
    Image ID:
    Port:                       8097/TCP
    State:                      Waiting
      Reason:                   ContainerCreating
    Ready:                      False
    Restart Count:              0
    Volume Mounts:              <none>
    Environment Variables:      <none>
Conditions:
  Type          Status
  Initialized   True 
  Ready         False 
  PodScheduled  True 
No volumes.
QoS Class:      BestEffort
Tolerations:    <none>
Events:
  FirstSeen     LastSeen        Count   From                    SubObjectPath   Type            Reason          Message
  ---------     --------        -----   ----                    -------------   --------        ------          -------
  12m           12m             1       {default-scheduler }                    Normal          Scheduled       Successfully assigned nginx-203864630-6rfgg to 127.0.0.1
  12m           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)"

  12m   11s     52      {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\""

2 解决过程

1 wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
2 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


3 结果

kubectl -s 'http://127.0.0.1:8099' get pods
NAME                    READY     STATUS    RESTARTS   AGE
nginx-203864630-6rfgg   1/1       Running   0          16m
nginx-203864630-zvgpt   1/1       Running   0          16m

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值