k8s中镜像导出的报错 not found

发布于:2024-12-18 ⋅ 阅读:(167) ⋅ 点赞:(0)

1.查看镜像

输入命令crictl images ls查看镜像

[root@master1 spider]# crictl images ls
IMAGE                                                                   TAG                 IMAGE ID            SIZE
registry.cn-beijing.aliyuncs.com/kubesphereio/cni                       v3.27.4             dc6f84c32585f       88.8MB
registry.cn-beijing.aliyuncs.com/kubesphereio/coredns                   1.9.3               5185b96f0becf       14.8MB
registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache        1.22.20             ff71cd4ea5ae5       30.5MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver            v1.26.15            61669ae28d85c       36.9MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager   v1.26.15            3b418eef6821c       33.5MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers          v3.27.4             6b1e38763f401       33.5MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy                v1.26.15            6c84132270a33       25.4MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy           v0.11.0             29589495df8d9       19.2MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler            v1.26.15            5626d764f1326       17.9MB
registry.cn-beijing.aliyuncs.com/kubesphereio/node-exporter             v1.3.1              1dbe0e9319764       10.3MB
registry.cn-beijing.aliyuncs.com/kubesphereio/node                      v3.27.4             3dd4390f2a85a       117MB
registry.cn-beijing.aliyuncs.com/kubesphereio/pause                     3.9                 e6f1816883972       322kB

2.导出镜像

[root@master1 ~]# ctr image export b.tar dc6f84c32585f
WARN[0000] DEPRECATION: The `mirrors` property of `[plugins."io.containerd.grpc.v1.cri".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0. Use `config_path` instead.
ctr: image "dc6f84c32585f": not found
[root@master1 ~]# ctr image export b.tar registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.27.4
WARN[0000] DEPRECATION: The `mirrors` property of `[plugins."io.containerd.grpc.v1.cri".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0. Use `config_path` instead.
ctr: image "registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.27.4": not found

可以看到提示镜像不存在,根据crictl命令查看到镜像是存在的

搜了一下两者的区别

ctr:containerd本身的CLI
crictl :Kubernetes社区的专门CLI工具

Kubernetes的镜像是放在k8s.io的namespace下的

ctr -n k8s.io image export b.tar 镜像名称:版本号


 

[root@master1 ~]# ctr -n k8s.io image export b.tar registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.27.4
WARN[0000] DEPRECATION: The `mirrors` property of `[plugins."io.containerd.grpc.v1.cri".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0. Use `config_path` instead.
[root@master1 ~]# ls
111              a.tar        dc6f84c32585f  ksp-v341-v126.yaml   kubekey-v3.1.6-linux-amd64.tar.gz  mysql-secret.yaml  test
anaconda-ks.cfg  b.tar        jiaoben.sh     ksp-v341-v1288.yaml  metrics-server-components.yaml     Redis-cluster
application      config.yaml  kk             kubekey              mysql                              spider
[root@master1 ~]#

可以看到镜像已经导出


网站公告

今日签到

点亮在社区的每一天
去签到