no such file or directory
程序员文章站
2022-03-08 19:29:03
...
pod启动一分钟了 还是出去未创建的状态,发现是无法下载镜像,
[[email protected] pod]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx 0/1 ContainerCreating 0 1m
[[email protected] 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\""
我们去节点上手动拉取镜像 试一试:也是不行的
[[email protected] ~]# 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
我们现在不需要去更改
更改下载镜像的地址为私有仓库的地址
[[email protected] ~]# 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
[[email protected] ~]# vim /etc/kubernetes/kubelet
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=10.0.0.61:5000/pod-infrastructure:latest"
systemctl restart kubelet.service
[[email protected] pod]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 23m
推荐阅读
-
sql2005 create file遇到操作系统错误5拒绝访问 错误1802
-
webpack file-loader和url-loader的区别
-
LNMP下提示File not found问题的解决方法
-
file_get_contents获取不到网页内容的解决方法
-
php读取本地文件常用函数(fopen与file_get_contents)
-
C#删除只读文件或文件夹(解决File.Delete无法删除文件)
-
ASP.NET The system cannot find the file specified解决办法
-
php中file_get_contents()函数用法实例
-
判断file框选择的是否为图片
-
chattr lsattr linux file system attributes - linux 文件系统扩展属性