windows 下 安装 minikube

2021-12-07 16:10:36 浏览数 (1)

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

代码语言:javascript复制
choco install minikube

如果安装了winget,则使用

代码语言:javascript复制
winget install minikube

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

代码语言:javascript复制
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:minikubeminikube.exe -Force


$oldpath=[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
if($oldpath -notlike "*;C:minikube*"){`
  [Environment]::SetEnvironmentVariable("Path", $oldpath ";C:minikube", [EnvironmentVariableTarget]::Machine)`
}
代码语言:javascript复制
PS C:WINDOWSsystem32> 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:////./pipe/docker_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:WINDOWSsystem32> minikube config set driver hyperv
! These changes will take effect upon a minikube delete and then a minikube start
PS C:WINDOWSsystem32> 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:WINDOWSsystem32> 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/

0 人点赞