使用minikube start命令提示错误,查看日志有这么一段报错

Unable to find image
'gcr.io/k8s-minikube/kicbase:v0.0.27@sha256:89b4738ee74ba28684676e176752277f0db46f57d27f0e08c3feec89311e22de'
locally

奇怪的是使用docker images命令查看本地有这个镜像,考虑网络原因使用了https_proxy还是提示错误

[yjn@minikube root]$ docker images
gcr.io/k8s-minikube/kicbase   v0.0.27   9fa1cc16ad6d   3 weeks ago   1.08GB

经过查询 发现 minikube 校验镜像时会用到一个 docker RepoDigest 的东西,其实就是上面日志里,镜像名后 @ 符号后面的一串摘要(sha256:xxx之类的一个校验码)

docker 镜像的 RepoDigest 可以使用上面代码中的命令查看:发现自动pull的镜像信息是<none>

[yjn@minikube root]$ docker images --format {{.Repository}}:{{.Tag}}@{{.Digest}}
gcr.io/k8s-minikube/kicbase:v0.0.27@<none>

经过再次查询发现可以在启动命令增加参数指定镜像

minikube start --driver=docker --base-image="yourimagename"

dockerhub上有同步的gcr.io/k8s-minikube/kicbase的一个镜像仓库
https://hub.docker.com/r/kicbase/stable/tags
使用命令下载这个镜像

docker pull kicbase/stable:v0.0.27
再次查看repodigest

[yjn@minikube root]$ docker images
REPOSITORY                    TAG       IMAGE ID       CREATED       SIZE
kicbase/stable                v0.0.27   9fa1cc16ad6d   3 weeks ago   1.08GB
gcr.io/k8s-minikube/kicbase   v0.0.27   9fa1cc16ad6d   3 weeks ago   1.08GB

[yjn@minikube root]$ docker images --format {{.Repository}}:{{.Tag}}@{{.Digest}}
kicbase/stable:v0.0.27@sha256:89b4738ee74ba28684676e176752277f0db46f57d27f0e08c3feec89311e22de
gcr.io/k8s-minikube/kicbase:v0.0.27@<none>

发现我们这次PULL的镜像是有这一个验证信息的,那么接下来就是在minikube start命令中指定自己的镜像

[yjn@minikube root]$ minikube start  --base-image="kicbase/stable:v0.0.27"

这次提示成功创建了集群

[yjn@minikube root]$ minikube start  --base-image="kicbase/stable:v0.0.27"
* Centos 7.9.2009 上的 minikube v1.23.2
* 根据现有的配置文件使用 docker 驱动程序
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* docker "minikube" container is missing, will recreate.
* Creating docker container (CPUs=2, Memory=2200MB) ...
! This container is having trouble accessing https://k8s.gcr.io
* To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
* 正在 Docker 20.10.8 中准备 Kubernetes v1.22.2…
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: storage-provisioner, default-storageclass
* kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

使用minikube status查看状态

[yjn@minikube root]$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
Last modification:October 29th, 2021 at 07:08 pm
If you think my article is useful to you, please feel free to appreciate