K8s: 在Windows10安裝執行Minikube並使用HyperV driver
阿新 • • 發佈:2018-12-17
安裝步驟
-
首先安裝Docker For Windows
https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows-desktop-app -
下載kubectl
curl -LO https://storage.googleapis.com/kubernetesrelease/release/v1.13.0/bin/windows/amd64/kubectl.exe
-
將kubectl.exe加到path
-
下載安裝Minikube
https://github.com/kubernetes/minikube/releases
由於是windows10,我選擇:(minikube-windows-amd64)[https://github.com/kubernetes/minikube/releases/download/v0.31.0/minikube-windows-amd64]
下載後重命名為:minikube.exe,然後加入環境path。 -
啟動HyperV
右鍵管理員執行powershell,執行命令:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
然後重啟電腦,如果需要。
-
建立SW
在搜尋中搜索hyper-v manager開啟後新建switch
-
Start
管理員執行cmd或者powershell:minikube start --hyperv-virtual-switch=SW4Minikube --vm-driver=hyperv
Troubleshooting
- Start
C:\Users\xxxx>minikube start Starting local Kubernetes v1.10.0 cluster... Starting VM... Downloading Minikube ISO 178.44 MB / 178.87 MB [============================================] 99.76% 0s 178.87 MB / 178.87 MB [============================================] 100.00% 0sE1213 17:47:37.761137 18592 start.go:180] Error starting host: Error creating host: Error executing step: Running precreate checks. : This computer is running Hyper-V. VirtualBox won't boot a 64bits VM when Hyper-V is activated. Either use Hyper-V as a driver, or disable the Hyper-V hypervisor. (To skip this check, use --virtualbox-no-vtx-check). Retrying. E1213 17:47:37.815463 18592 start.go:186] Error starting host: Error creating host: Error executing step: Running precreate checks. : This computer is running Hyper-V. VirtualBox won't boot a 64bits VM when Hyper-V is activated. Either use Hyper-V as a driver, or disable the Hyper-V hypervisor. (To skip this check, use --virtualbox-no-vtx-check) ================================================================================ An error has occurred. Would you like to opt in to sending anonymized crash information to minikube to help prevent future errors? To opt out of these messages, run the command: minikube config set WantReportErrorPrompt false ================================================================================ Please enter your response [Y/n]: Y
解決方案:同上,設定hyperv driver。
- Error
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
E1214 10:02:40.692867 5296 start.go:180] Error starting host: Error starting stopped host: exit status 1.
Retrying.
E1214 10:02:40.695827 5296 start.go:186] Error starting host: Error starting stopped host: exit status 1
解決方案:
- 如何開啟HyperV服務
參考:https://jingyan.baidu.com/article/c33e3f48f0a42eea14cbb557.html