波波技术栈
article

minikube start启动失败无法加载缓存的镜像:LoadCachedImages: GetFileAttributesEx

minikube start 启动失败,报错“无法加载缓存的镜像:LoadCachedImages: GetFileAttributesEx”,原因是 registry.k8s.io 在国内访问不稳定,导致所需镜像无法下载到本地缓存。解决方法是以管理员身份运行 PowerShell,先执行 minikube delete 删除失败集群,再使用阿里云镜像源重新启动,例如指定 --image-repository=registry.cn-hangzhou.ali。

问题:

启动执行


PS C:\Users\Administrator> minikube start
* Microsoft Windows 11 Enterprise Ltsc 2024 24H2 上的 minikube v1.38.1
...
! The image 'registry.k8s.io/kube-apiserver:v1.35.1' was not found; unable to add it to cache.
! The image 'registry.k8s.io/kube-controller-manager:v1.35.1' was not found; unable to add it to cache.
* 正在 Docker 28.5.2 中准备 Kubernetes v1.35.1…\
X 无法加载缓存的镜像:LoadCachedImages: GetFileAttributesEx C:\Users\Administrator\.minikube\cache\images\amd64\registry.k8s.io\kube-apiserver_v1.35.1: The system cannot find the file specified.

解决:

由于 registry.k8s.io 在国内访问不稳定或被阻断,你需要告诉 Minikube 使用国内的镜像仓库代理。

请以‌管理员身份‌打开 PowerShell,先删除旧的失败集群,然后使用以下命令重新启动:

# 1. 删除之前启动失败的集群
minikube delete

# 2. 使用阿里云镜像源重新启动 
minikube start --driver=hyperv --image-mirror-country=cn --image-repository=registry.cn-hangzhou.ali