k8s Failed to create pod sandbox错误处理

这篇具有很好参考价值的文章主要介绍了k8s Failed to create pod sandbox错误处理。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

错误信息:

Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "k8s.gcr.io/pause:3.2": failed to pull image "k8s.gcr.io/pause:3.2": failed to pull and unpack image "k8s.gcr.io/pause:3.2": failed to resolve reference "k8s.gcr.io/pause:3.2": failed to do request: Head "https://k8s.gcr.io/v2/pause/manifests/3.2": dial tcp 74.125.204.82:443: i/o timeout

# 查看本机的镜像
# k8s + docker
$ docker images
# k8s + containerd
$ crictl images

很明显是无法拉取 k8s.gcr.io/pause:3.2 这个镜像,但我们的k8s明明使用的事pause:3.5的版本,这可能是该k8s版本的一个bug

临时解决方案:

可以从国内镜像仓库来拉取谷歌的镜像,然后重新tag。

以阿里云为例,访问下面地址,可搜索自己拉取失败的镜像。

容器镜像服务 (aliyun.com)https://cr.console.aliyun.com/cn-hangzhou/instances/images例如解决上面的问题,我们就搜索pause

# 如果你的k8s使用的事docker客户端
$ docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.2
$ docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.2 k8s.gcr.io/pause:3.2 

# 如果使用containerd自带客户端
$ crictl pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.2
$ ctr -n k8s.io i tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.2 k8s.gcr.io/pause:3.2

推荐解决方案:文章来源地址https://www.toymoban.com/news/detail-594565.html

# 查看 kubelet 配置
$ systemctl status -l kubelet

$ cd /var/lib/kubelet/
$ cp kubeadm-flags.env kubeadm-flags.env.ori

# 把 k8s.gcr.io/pause:3.3 改成 registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.2

$ cat /var/lib/kubelet/kubeadm-flags.env

$ KUBELET_KUBEADM_ARGS="--cgroup-driver=systemd --network-plugin=cni --pod-infra-container-image=registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.2"

# 重启 kubelet 服务
$ systemctl daemon-reload
$ systemctl restart kubelet

到了这里,关于k8s Failed to create pod sandbox错误处理的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • failed to get sandbox image “k8s.gcr.io/pause:3.6“: failed to pull image “k8s.gcr.io/pause:3.6“

    从日志能够看到k8s核心服务的pod创建失败,因为获取pause镜像失败,总是从k8s.gcr.io下载。 经过确认,k8s 1.26中启用了CRI sandbox(pause) image的配置支持。 之前通过kubeadm init –image-repository设置的镜像地址,不再会传递给cri运行时去下载pause镜像 而是需要在cri运行时的配置文件中设

    2024年02月16日
    浏览(39)
  • 记NVIDIA显卡A100在K8S POD中“Failed to initialize NVML: Unknown Error“问题解决

    因项目原因需要在k8s上跑GPU相关的代码,优选使用NVIDIA A100显卡,但在根据官方文档简单并部署GitHub - NVIDIA/k8s-device-plugin:适用于 Kubernetes 的 NVIDIA 设备插件后,出现了pod中GPU运行一段时间后丢失的问题,进入容器后发现nvidia-smi命令报错\\\"Failed to initialize NVML: Unknown Error\\\"。尝试

    2024年02月08日
    浏览(49)
  • Kubernetes Pod报错 filed to get sandbox image “k8s.gcr.io/pause:3.6“

            最近工作中在部署Pod后发现无法正常启动,查看Pod详情后看到以下报错信息:         问题的原因是因为调度的这台服务器上没有 k8s.gcr.io/pause:3.6 镜像,所以我们把镜像下载到这台服务器就可以了,执行命令:         到此 Kubernetes Pod报错 filed to get sandbox image

    2024年02月16日
    浏览(35)
  • 清理k8s集群Evicted,Failed的Pod!

    简介:不知知道各位是如何清理的,我尝试过用阿里的任何一个面板清理,但是还要换页就很烦,所以自己就写了一个小脚本,更GOOD!的是你还可以把他放到你的定时任务里面去,为啥要这么做,不得不说,咱的集群有点小垃圾,不过那也没办法,集群也不敢动,谁知道啥时

    2024年02月20日
    浏览(29)
  • k8s 启动 elasticsearch 失败: [failed to bind service]

    具体的错误信息 k logs -f elasticsearch-0 -n kube-system 排查最后导致启动失败的原因是,我的 elasticsearch 使用到了 pv、pvc 来做持久化存储,但是 elasticsearch 对我的挂载目录没有执行权限。 chmod 777 elasticsearch 之后重启 pod 即可。

    2024年02月15日
    浏览(44)
  • 解决k8s node节点报错: Failed to watch *v1.Secret: unknown

    现象:  这个现象是发生在k8s集群证书过期,重新续签证书以后。 记得master节点的/etc/kubernetes/kubelet.conf文件已经复制到node节点了。 但是为什么还是报这个错,然后运行证书检查命令看一下:   看样子是差/etc/kubernetes/pki/apiserver.crt文件。 但是从master节点scpapiserver.crt文件以

    2024年01月16日
    浏览(38)
  • kubeadm init:failed to pull image registry.k8s.io/pause:3.6

    错误信息: Unfortunately, an error has occurred:         timed out waiting for the condition This error is likely caused by:         - The kubelet is not running         - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled) If you are on a systemd-powered system, you can try to troubleshoot

    2024年02月14日
    浏览(41)
  • kubeadm init [ERROR ImagePull]: failed to pull image registry.k8s.io 解决方法

    ** https://blog.itwk.cc 由于国内网络原因,kubeadm init部署集群会卡住不动,,报错如下: error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.25.6: output: E0124 00:28:25.369652 3299 remote_image.go:171] “PullImage from image service failed”

    2024年02月11日
    浏览(38)
  • kubeadm init 失败: failed to pull image k8s.gcr.io/etcd:3.4.13-0

    报错: 因为k8s.gcr.io镜像库在国内需要翻墙,所以普通下载无法成功完成,可以更改一下下载的镜像库地址为国内地址,下载后将标签打回和kubeadm config一致的方法解决。 更改前查看镜像地址 更改镜像基地址

    2024年02月11日
    浏览(27)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包