windows 下 安装 minikube

4.3
(3)

如果电脑上安装了chocolatey,则使用

choco install minikube

如果安装了winget,则使用

winget install minikube

如果上面的两个都没有安装,则用打开一个管理员权限的powershell,然后按照下面的步骤运行:

curl -Lo minikube.exe https://github.com/kubernetes/minikube/releases/latest/download/minikube-windows-amd64.exe
New-Item -Path "c:\" -Name "minikube" -ItemType "directory" -Force
Move-Item .\minikube.exe c:\minikube\minikube.exe -Force


$oldpath=[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
if($oldpath -notlike "*;C:\minikube*"){`
  [Environment]::SetEnvironmentVariable("Path", $oldpath+";C:\minikube", [EnvironmentVariableTarget]::Machine)`
}

PS C:\WINDOWS\system32> minikube start
* Microsoft Windows 10 Pro 10.0.19043 Build 19043 上的 minikube v1.22.0
* 根据用户配置使用 docker 驱动程序

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.* 文档:https://minikube.sigs.k8s.io/docs/drivers/docker/

PS C:\WINDOWS\system32> minikube config set driver hyperv
! These changes will take effect upon a minikube delete and then a minikube start
PS C:\WINDOWS\system32> minikube start
* Microsoft Windows 10 Pro 10.0.19043 Build 19043 上的 minikube v1.22.0
* 根据用户配置使用 hyperv 驱动程序
* 正在下载 VM boot image...
    > minikube-v1.22.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
    > minikube-v1.22.0.iso: 242.95 MiB / 242.95 MiB [ 100.00% 10.69 MiB p/s 23s
* Starting control plane node minikube in cluster minikube
* Downloading Kubernetes v1.21.2 preload ...
    > preloaded-images-k8s-v11-v1...: 502.14 MiB / 502.14 MiB  100.00% 9.64 MiB
* Creating hyperv VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
! This VM 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.6 中准备 Kubernetes v1.21.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
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
PS C:\WINDOWS\system32> minikube dashboard --url
* 正在开启 dashboard ...
  - Using image kubernetesui/dashboard:v2.1.0
  - Using image kubernetesui/metrics-scraper:v1.0.4
* 正在验证 dashboard 运行情况 ...
* Launching proxy ...
* 正在验证 proxy 运行状况 ...
http://127.0.0.1:55123/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/

这篇文章有用吗?

平均评分 4.3 / 5. 投票数: 3

到目前为止还没有投票!成为第一位评论此文章。

很抱歉,这篇文章对您没有用!

让我们改善这篇文章!

告诉我们我们如何改善这篇文章?


了解 工作生活心情记忆 的更多信息

Subscribe to get the latest posts sent to your email.

分类: