运行 minikube 启动时 vswitch 未找到 hyperV
vswitch not found hyperV while running minikube start
我创建了一个名为 "Minikube2" 的虚拟交换机。之前我创建了名为 "minikube" 的虚拟交换机,但后来由于配置问题将其删除。
是否完成所有需要的配置 -"sharing on ethernet .."
现在当我尝试 运行
minikube 启动 --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2"
它下载了 ISO,但未能配置开关 -
它说 vswitch "minikube2" 未找到
简短的回答是删除 C:\Users\%USERNAME%\.minikube
并重试。
以下是我的调查:
首先,我创建了虚拟交换机 "minikube",启动了集群,它按预期工作。
然后我停止了 minikube,创建了新的 "Minikube2" 开关并启动了 minikube
minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2" --v=9
出现的问题:
Starting local Kubernetes v1.10.3 cluster... Starting VM... [executing
==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state [stdout =====>] : Off
[stderr =====>] : [executing ==>] :
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile
-NonInteractive Hyper-V\Start-VM minikube [stdout =====>] : [stderr =====>] : Hyper-V\Start-VM : 'minikube' failed to start. Synthetic Ethernet Port (Instance ID AF9D08DC-2625-4F24-93E5-E09BAD904899):
Error 'Insufficient system resources exist to complete the requested
service.'. Failed to allocate resources while connecting to a virtual
network. The Ethernet switch may not exist. 'minikube' failed to
start. (Virtual machine ID 863D6558-78EC-4648-B712-C1FDFC907588)
'minikube' Synthetic Ethernet Port: Failed to finish reserving
resources with Error 'Insufficient system resources exist to complete
the requested service.' (0x800705AA). (Virtual machine ID
863D6558-78EC-4648-B712-C1FDFC907588) 'minikube' failed to allocate
resources while connecting to a virtual network: Insufficient system
resources exist to complete the requested service. (0x800705AA)
(Virtual Machine ID 863D6558-78EC-4648-B712-C1FDFC907588). The
Ethernet switch may not exist. Could not find Ethernet switch
'minikube'. At line:1 char:1
+ Hyper-V\Start-VM minikube
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Start-VM], VirtualizationException
+ FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.StartVM
E1022 12:50:43.384867 6216 start.go:168] Error starting host: Error
starting stopped host: exit status 1.
Retrying. E1022 12:50:43.398832 6216 start.go:174] Error starting
host: Error starting stopped host: exit status 1 PS
C:\Windows\system32>
然后我删除了 C:\Users\%USERNAME%\.minikube
, Hyper-V 中的 minikube 虚拟机并重新启动:
C:\Windows\system32> minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2" --v=9
结果:
Starting local Kubernetes v1.10.3 cluster... Starting VM...
Downloading Minikube ISO
170.78 MB / 170.78 MB [============================================] 100.00% 0s
Creating CA: C:\Users\Vitalii.minikube\certs\ca.pem
Creating client certificate: C:\Users\Vitalii.minikube\certs\cert.pem
----- [stderr =====>] : Using switch "Minikube2"
----- Moving files into cluster...
Downloading kubeadm v1.10.3
Downloading kubelet v1.10.3 Finished
Downloading kubeadm v1.10.3 Finished
Finished Downloading kubelet v1.10.3
Setting up certs... Connecting to
cluster... Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
PS C:\Windows\system32> kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-c4cffd6dc-cjzsm 1/1 Running 0 1m
kube-system etcd-minikube 1/1 Running 0 56s
kube-system kube-addon-manager-minikube 1/1 Running 0 13s
kube-system kube-apiserver-minikube 1/1 Running 0 41s
kube-system kube-controller-manager-minikube 1/1 Running 0 1m
kube-system kube-dns-86f4d74b45-w62rv 2/3 Running 0 1m
kube-system kube-proxy-psgss 1/1 Running 0 1m
kube-system kube-scheduler-minikube 1/1 Running 0 21s
kube-system kubernetes-dashboard-6f4cfc5d87-jz266 1/1 Running 0 1m
kube-system storage-provisioner 1/1 Running 0 1m
看起来 HyperV 驱动程序有一些问题 运行ning Minikube。对我来说,在 Windows 上尝试 运行 它时,使用 docker 驱动程序要简单得多。只是 运行:
minikube start --driver=docker
而且它没有问题。确保您的 docker 守护程序是 运行ning,例如使用 Docker 桌面。有关驱动程序的参考,请查看此处:https://kubernetes.io/docs/setup/learning-environment/minikube/#specifying-the-vm-driver
我创建了一个名为 "Minikube2" 的虚拟交换机。之前我创建了名为 "minikube" 的虚拟交换机,但后来由于配置问题将其删除。
是否完成所有需要的配置 -"sharing on ethernet .."
现在当我尝试 运行
minikube 启动 --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2"
它下载了 ISO,但未能配置开关 -
它说 vswitch "minikube2" 未找到
简短的回答是删除 C:\Users\%USERNAME%\.minikube
并重试。
以下是我的调查:
首先,我创建了虚拟交换机 "minikube",启动了集群,它按预期工作。 然后我停止了 minikube,创建了新的 "Minikube2" 开关并启动了 minikube
minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2" --v=9
出现的问题:
Starting local Kubernetes v1.10.3 cluster... Starting VM... [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state [stdout =====>] : Off
[stderr =====>] : [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Hyper-V\Start-VM minikube [stdout =====>] : [stderr =====>] : Hyper-V\Start-VM : 'minikube' failed to start. Synthetic Ethernet Port (Instance ID AF9D08DC-2625-4F24-93E5-E09BAD904899): Error 'Insufficient system resources exist to complete the requested service.'. Failed to allocate resources while connecting to a virtual network. The Ethernet switch may not exist. 'minikube' failed to start. (Virtual machine ID 863D6558-78EC-4648-B712-C1FDFC907588) 'minikube' Synthetic Ethernet Port: Failed to finish reserving resources with Error 'Insufficient system resources exist to complete the requested service.' (0x800705AA). (Virtual machine ID 863D6558-78EC-4648-B712-C1FDFC907588) 'minikube' failed to allocate resources while connecting to a virtual network: Insufficient system resources exist to complete the requested service. (0x800705AA) (Virtual Machine ID 863D6558-78EC-4648-B712-C1FDFC907588). The Ethernet switch may not exist. Could not find Ethernet switch 'minikube'. At line:1 char:1 + Hyper-V\Start-VM minikube + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Start-VM], VirtualizationException + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.StartVM
E1022 12:50:43.384867 6216 start.go:168] Error starting host: Error starting stopped host: exit status 1.
Retrying. E1022 12:50:43.398832 6216 start.go:174] Error starting host: Error starting stopped host: exit status 1 PS C:\Windows\system32>
然后我删除了 C:\Users\%USERNAME%\.minikube
, Hyper-V 中的 minikube 虚拟机并重新启动:
C:\Windows\system32> minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2" --v=9
结果:
Starting local Kubernetes v1.10.3 cluster... Starting VM...
Downloading Minikube ISO
170.78 MB / 170.78 MB [============================================] 100.00% 0s Creating CA: C:\Users\Vitalii.minikube\certs\ca.pem
Creating client certificate: C:\Users\Vitalii.minikube\certs\cert.pem
----- [stderr =====>] : Using switch "Minikube2"
----- Moving files into cluster...
Downloading kubeadm v1.10.3
Downloading kubelet v1.10.3 Finished
Downloading kubeadm v1.10.3 Finished
Finished Downloading kubelet v1.10.3
Setting up certs... Connecting to
cluster... Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
PS C:\Windows\system32> kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-c4cffd6dc-cjzsm 1/1 Running 0 1m
kube-system etcd-minikube 1/1 Running 0 56s
kube-system kube-addon-manager-minikube 1/1 Running 0 13s
kube-system kube-apiserver-minikube 1/1 Running 0 41s
kube-system kube-controller-manager-minikube 1/1 Running 0 1m
kube-system kube-dns-86f4d74b45-w62rv 2/3 Running 0 1m
kube-system kube-proxy-psgss 1/1 Running 0 1m
kube-system kube-scheduler-minikube 1/1 Running 0 21s
kube-system kubernetes-dashboard-6f4cfc5d87-jz266 1/1 Running 0 1m
kube-system storage-provisioner 1/1 Running 0 1m
看起来 HyperV 驱动程序有一些问题 运行ning Minikube。对我来说,在 Windows 上尝试 运行 它时,使用 docker 驱动程序要简单得多。只是 运行:
minikube start --driver=docker
而且它没有问题。确保您的 docker 守护程序是 运行ning,例如使用 Docker 桌面。有关驱动程序的参考,请查看此处:https://kubernetes.io/docs/setup/learning-environment/minikube/#specifying-the-vm-driver