K8s: 在Windows10安装运行Minikube并使用HyperV driver

版权声明:本文为博主原创文章,未经博主允许不得转载。PS: 转载请注明出处 http://blog.csdn.net/ouyangtianhan https://blog.csdn.net/ouyangtianhan/article/details/84992675

安装步骤

  1. 首先安装Docker For Windows
    https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows-desktop-app

  2. 下载kubectl
    curl -LO https://storage.googleapis.com/kubernetesrelease/release/v1.13.0/bin/windows/amd64/kubectl.exe

  3. 将kubectl.exe加到path

  4. 下载安装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。

  5. 启动HyperV
    右键管理员运行powershell,执行命令:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
    然后重启电脑,如果需要
    1

  6. 创建SW
    在搜索中搜索hyper-v manager打开后新建switch
    1
    2

  7. 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

解决方案:

参考

https://kubernetes.io/docs/setup/minikube/#quickstart

猜你喜欢

转载自blog.csdn.net/ouyangtianhan/article/details/84992675