Minikube 无法在 Windows 11 家庭版和 Docker 桌面上启动

lik*_*udo 2 docker kubernetes minikube

我有 Windows 11 家庭版(不允许 Hyper-V,只有专业版允许)。安装了 WSL2 和 Docker Desktop。

使用 Chocolatey 安装了 Minikube,但它拒绝启动。在 SO 上搜索,我在几篇文章中找到了这个建议,但它失败了。

PS C:\WINDOWS\system32> docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all dangling build cache

Are you sure you want to continue? [y/N] y
error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/prune": open //./pipe/docker_engine: The system cannot find the file specified.

PS C:\WINDOWS\system32> minikube delete
* Removed all traces of the "minikube" cluster.

PS C:\WINDOWS\system32> minikube start --driver=docker
* minikube v1.25.2 on Microsoft Windows 11 Home 10.0.22000 Build 22000
* Using the docker driver based on user configuration

X Exiting due to PROVIDER_DOCKER_VERSION_EXIT_1: "docker version --format -" exit status 1: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.
* Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/
Run Code Online (Sandbox Code Playgroud)

lik*_*udo 7

我想在启动 minikube之前尝试让Docker Desktop运行起来。

我从 Windows“开始”菜单以管理员模式运行 Docker Desktop

现在我再次运行命令来删除旧的东西,

PS C:\WINDOWS\system32> minikube delete
* Removed all traces of the "minikube" cluster.
Run Code Online (Sandbox Code Playgroud)

现在指定 docker 驱动程序

PS C:\WINDOWS\system32> minikube start --driver=docker
* minikube v1.25.2 on Microsoft Windows 11 Home 10.0.22000 Build 22000
* Using the docker driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
    > gcr.io/k8s-minikube/kicbase: 379.06 MiB / 379.06 MiB  100.00% 10.23 MiB p
* Creating docker container (CPUs=2, Memory=3000MB) ...
* Preparing Kubernetes v1.23.3 on Docker 20.10.12 ...
  - kubelet.housekeeping-interval=5m
  - 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
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
Run Code Online (Sandbox Code Playgroud)

现在验证 minikube 状态

PS C:\WINDOWS\system32> minikube delete
* Removed all traces of the "minikube" cluster.
Run Code Online (Sandbox Code Playgroud)

我在学习 kubernetes 时并不了解它,但它似乎有效。我希望这对某些人有用,这样他们就不必花 99 美元升级到 Windows Pro——如果这不起作用,我就会这么做。

更新:这里有一个链接,提供更多详细信息如何在 Windows 11 上运行 Kubernetes