no such file or directory

pod启动一分钟了 还是出去未创建的状态,发现是无法下载镜像,

[root@k8s-m01 pod]# kubectl get pod
NAME      READY     STATUS              RESTARTS   AGE
nginx     0/1       ContainerCreating   0          1m
[root@k8s-m01 pod]# kubectl describe pod nginx

  FirstSeen	LastSeen	Count	From			SubObjectPath	Type   Reason		Message
  ---------	--------	-----	----			-------------	-------------		-------
  2m		2m		1	{default-scheduler }			Normal Scheduled	Successfully assigned nginx to 10.0.0.63
  2m		37s		4	{kubelet 10.0.0.63}			WarningFailedSync	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)"

  1m	11s	6	{kubelet 10.0.0.63}		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\""

我们去节点上手动拉取镜像 试一试:也是不行的

[root@k8s-m03 ~]# docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latestTrying to pull repository registry.access.redhat.com/rhel7/pod-infrastructure ... 
open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory

我百度了一下
https://cloud.tencent.com/developer/article/1156329

我们现在不需要去更改
更改下载镜像的地址为私有仓库的地址

[root@k8s-m03 ~]# vim /etc/kubernetes/kubelet 
#这里指定地址  是从红帽官方去pull的 
# pod infrastructure container
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel
7/pod-infrastructure:latest"

把这个地址 改成私有仓库地址 ,就可以从私有仓库pull了

docker search ylmcr7/pod-infrastructure:latest
docker tag ylmcr7/pod-infrastructure:latest 10.0.0.61:5000/pod-infrastructure:latest


[root@k8s-m03 ~]# vim /etc/kubernetes/kubelet 
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=10.0.0.61:5000/pod-infrastructure:latest"

systemctl restart kubelet.service
[root@k8s-m01 pod]# kubectl get pod
NAME      READY     STATUS    RESTARTS   AGE
nginx     1/1       Running   0          23m
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云原生解决方案

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值