[问题已处理]-docker切换到containerd之后导入镜像报错failed to create snapshot- missing parent

导语:k8s运行时从docker切换到containerd时出现了镜像snapshot的报错。初衷是想切换的更快更平滑。所以在未切换前,用ctr命令先把镜像导入到containerd中,导入显示成功(此时还是docker运行时)。再做切换,切到containerd,但运行容器报错failed to create snapshot: missing parent 。并且删除镜像后再次导入也不行。

报错如下

failed to pull and unpack image “harbor.deepwise.com/dev/licenseconsole:release-v1.0.1-231130_c5af537_21”: unable to prepare extraction snapshot: target snapshot “sha256:63290f9c9e5201f0507ee1b5701aa06c7f48bef7cce287fc77db92bec634d737”: already exists

image-20240410154038097

failed to create snapshot: missing parent “k8s.io/26/sha256:5af4f8f59b764c64c6def53f52ada809fe38d528441d08d01c206dfb3fc3b691” bucket: not found

image-20240410154317835

测试情况1

复现步骤如下

查看当前k8s的运行时

image-20240410145224907

导入镜像并测试

image-20240410145430207

ctr运行可用

image-20240410150915289

        cat >  /etc/crictl.yaml << EOF
        runtime-endpoint: unix:///run/containerd/containerd.sock
        image-endpoint: unix:///run/containerd/containerd.sock
        timeout: 10
        debug: false
        pull-image-on-create: false
EOF

修改/etc/containerd/config.toml如下

disabled_plugins = []
imports = []
oom_score = 0
plugin_dir = ""
required_plugins = []
root = "/var/lib/containerd"
state = "/run/containerd"
temp = ""
version = 2

[cgroup]
  path = ""

[debug]
  address = ""
  format = ""
  gid = 0
  level = ""
  uid = 0

[grpc]
  address = "/run/containerd/containerd.sock"
  gid = 0
  max_recv_message_size = 16777216
  max_send_message_size = 16777216
  tcp_address = ""
  tcp_tls_ca = ""
  tcp_tls_cert = ""
  tcp_tls_key = ""
  uid = 0

[metrics]
  address = ""
  grpc_histogram = false

[plugins]

  [plugins."io.containerd.gc.v1.scheduler"]
    deletion_threshold = 0
    mutation_threshold = 100
    pause_threshold = 0.02
    schedule_delay = "0s"
    startup_delay = "100ms"

  [plugin
  • 6
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

爷来辣

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

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

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

打赏作者

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

抵扣说明:

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

余额充值