minikube not starting once my laptop connects to a VPN - kubernetes

When I am not connected to the VPN, minikube is starting as expected:
PS C:\Windows\system32> minikube start
* minikube v1.9.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on existing profile
* Starting control plane node m01 in cluster minikube
* Updating the running hyperv "minikube" VM ...
* Preparing Kubernetes v1.18.0 on Docker 19.03.8 ...
E0408 01:00:31.223159 17528 kubeadm.go:331] Overriding stale ClientConfig host https://192.168.137.249:8443 with https://172.17.118.34:8443
* Enabling addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube"
Once I am connectong to the VPN antri triing to start the minikube, it fails with an error:
PS C:\Windows\system32> minikube start
* minikube v1.9.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on existing profile
* Starting control plane node m01 in cluster minikube
* Updating the running hyperv "minikube" VM ...
! StartHost failed, but will try again: provision: IP not found
* Updating the running hyperv "minikube" VM ...
*
X Failed to start hyperv VM. "minikube start" may fix it.: provision: IP not found
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
- https://github.com/kubernetes/minikube/issues/new/choose

I was facing a similar issue while running the following command:
minikube start --vm-driver="hyperv" --hyperv-virtual-switch="minikube"
Then I went through some github and stackoverflow threads and was able to resolve my issue by running following command:
minikube delete
minikube start --vm-driver="hyperv"
In my case, passing 'hyperv-virtual-switch' argument was causing the issue.
I would suggest you to check if your virtual switch is configured with your vpn network or not.
If not, then you can perform the following steps to do so:
Go to network and sharing center settings of windows:
Select your network and open the properties window for it. Go to the "Sharing" tab and allow your configured virtual switch over there.

Related

Minikube: Unable to start minikube - Exiting due to DRV_NO_IP:

I am trying to create the minikube cluster, but It always fails.
Any suggestions are very welcome:
C:\WINDOWS\system32>minikube start --driver=vmware
minikube v1.16.0 on Microsoft Windows 10 Home 10.0.19042 Build 19042
Using the vmware driver based on user configuration
Starting control plane node minikube in cluster minikube
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Deleting "minikube" in vmware ...
! StartHost failed, but will try again: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Failed to start vmware VM. Running "minikube delete" may fix it: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
X Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Suggestion: Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --driver=none
Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/
Related issues:
https://github.com/kubernetes/minikube/issues/4249
https://github.com/kubernetes/minikube/issues/3566
I had a similar error when setting up Minikube on Mac OS.
When I run the command minikube start I get the error below:
😄 minikube v1.22.0 on Darwin 11.4
✨ Using the vmware driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🏃 Updating the running vmware "minikube" VM ...
🤦 StartHost failed, but will try again: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
🏃 Updating the running vmware "minikube" VM ...
😿 Failed to start vmware VM. Running "minikube delete" may fix it: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
❌ Exiting due to GUEST_PROVISION: Failed to start host: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
The issue was caused by an interruption when I was creating the VMWare VM for Minikube.
I tried fixing it by deleting the existing minikube vm and creating another one using:
minikube delete
minikube start
But then I ran into another issue this time:
Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting.
Here's how I fixed it
After multiple research, it's just best to set up minikube with docker driver which will save you all this hassle.
For Mac OS:
If you already have docker installed or docker-compose simply uninstall it using:
brew uninstall docker
brew uninstall docker-compose
Next, install Docker desktop. This will install Docker/Docker Desktop, Docker-compose and other dependencies using:
brew install --cask docker
Next, start the docker engine by opening the Docker application. Afterwhich you can confirm the docker version using:
docker --version
Finally, setup minikube using docker driver:
minikube start --driver=docker

Minikube hanging on Creating hyperv VM

Heads up: I need Hyper-V as VM driver because I want to be able to use the ingress addon; using Docker as the driver will not allow the use of addons in Windows.
I am using Minikube v1.11.0 and Kubernetes v1.18.3. When I am trying to create and launch a Minikube cluster according to this tutorial with Hyper-V in PowerShell it keeps hanging on 'Creating hyperv VM:
PS C:\WINDOWS\system32> minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
* minikube v1.11.0 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
- KUBECONFIG=~/.kube/config
* Using the hyperv driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Creating hyperv VM (CPUs=4, Memory=4096MB, Disk=20000MB) ...
After about 10 minutes it goes further and crashes with this errors:
* Stopping "minikube" in hyperv ...
* Powering off "minikube" via SSH ...
* Deleting "minikube" in hyperv ...
! StartHost failed, but will try again: creating host: create host timed out in 240.000000 seconds
E0605 19:02:43.905739 30748 main.go:106] libmachine: [stderr =====>] : Hyper-V\Get-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:3
+ ( Hyper-V\Get-VM minikube ).state
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (minikube:String) [Get-VM], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM
...
Multiple E0605 errors
...
* Failed to start hyperv VM. "minikube start" may fix it: creating host: create host timed out in 240.000000 seconds
*
* [CREATE_TIMEOUT] error provisioning host Failed to start host: creating host: create host timed out in 240.000000 seconds
* Suggestion: Try 'minikube delete', and disable any conflicting VPN or firewall software
* Related issue: https://github.com/kubernetes/minikube/issues/7072
What to do?
According to the tutorial you followed you have to make a new virtual network switch in the Hyper-V Manager with the type External. The author does not explain why the network switch has to be external, other than that this configuration is best for avoiding headaches with Minikube not working properly with other software.
For some reason the External type of the virtual network switch was the problem, instead of External type use the Internal type for your virtual network switch in the Hyper-V Manager. Then run the following command to delete the wrong configurated cluster and to clean up:
minikube delete
Now, re-run the create/launch command for your Minikube cluster with your internal virtual network switch:
minikube start --vm-driver hyperv --hyperv-virtual-switch "Your Internal Virtual Switch"
Now you're all set with your new cluster when it finishes correctly!
Fix On Azure VM in Windows Server 2019:
Check if minikube VM has an IP Address in Networking tab
If NO IP address and no DHCP is running in VM, then go to next step
Create new InternalNAT switch:
Powershell:
New-VMSwitch -Name "InternalNAT" -SwitchType Internal
Get-NetAdapter
# Take note of the "ifIndex" for the virtual switch you just created, assuming 13
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex 13
New-NetNat -Name "InternalNat" -InternalIPInterfaceAddressPrefix 192.168.0.0/24
Create DHCP Server
Create new scope for 192.168.. (or any range, note down this range)
Delete and Re-create minikube and use "InternalNat" switch
minikube start --vm-driver hyperv --hyperv-virtual-switch "InternalNAT"
Use minikube start --hyperv-use-external-switch instead!

Can't get Minikube to run on Windows 10

I installed Minikube on Windows 10 but can't get it to run. I tried to start it with:
minikube start --vm-driver=hyperv
The first error was:
[HYPERV_NO_VSWITCH] create: precreate: no External vswitch found. A valid vswitch must be available for this command to run.
I then searched on Google and found the solution to this error with this page:
https://www.codingepiphany.com/2019/01/04/kubernetes-minikube-no-external-vswitch-found/
I then fixed the problem by defining a vswitch but I got this error:
minikube start --vm-driver hyperv --hyperv-virtual-switch "Minikube"
o minikube v1.0.1 on windows (amd64)
$ Downloading Kubernetes v1.14.1 images in the background ...
> Creating hyperv VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
! Unable to start VM: create: creating: exit status 1
* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
- https://github.com/kubernetes/minikube/issues/new
This is a pretty generic error. What do I do to get this working? Thanks!
You need to create a Virtual Switch in the HyperV GUI ins Windows and then run it with
minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
Please see the configuration details in this link
https://medium.com/#JockDaRock/minikube-on-windows-10-with-hyper-v-6ef0f4dc158c
I got the same problem just now.
Unable to understand the note given by cmd, I tried open the minikube VM via the Hyper-V GUI, and the GUI provided me with a more comprehensible note: "memory is not adequate"—— exactly this note helped me to know the problem. I then closed Docker VM (I had opened before), which must have taken a large amount of memory, and started minikube in cmd again, the minikube VM just started as expected.
In a word, this is a problem of limited memory

Error Starting Minikube on Ubuntu VM VirutalBox

I do have an Ubuntu VM in VirtualBox on Windows 10. If i follow the instructions to install Minikube I get a start error:
> minikube start &
[1] 4297
vagrant#ubuntu-xenial:~$ o minikube v0.35.0 on linux (amd64)
> Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
# Downloading Minikube ISO ...
184.42 MB / 184.42 MB [============================================] 100.00%
0s
! Unable to start VM: create: precreate: VBoxManage not found. Make sure
VirtualBox is installed and VBoxManage is in the path
Does it mean i need to install VirtualBox in the Ubuntu VM too? Kind of VB inside VB..
thanks
I'd recommend to install Minikube on your host OS (Windows) and use the already installed Virtual box as a hypervisor provider.
If for any reason you want to launch it on Ubuntu VM, there are two options:
I. Minikube supports a --vm-driver=none option that runs the Kubernetes components on the host and not in a VM. Using this driver requires Docker and a Linux environment, but not a hypervisor. In this case you have to provide an address to you local API server
`minikube start --vm-driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost`
And then go and edit ~/.kube/config, replacing the server IP that was
detected from the main network interface with "localhost". For example:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data:/home/asuh/.minikube/ca.crt
server: https://localhost:8443
name: minikube
II. Install VM Ware on Windows and run Ubuntu within installed Virtualbox
and and enabled VT-X/AMD-v in outer VM.
Regarding the error you have at the moment:
However now i get another error like: /usr/local/bin/minikube: cannot
execute binary file
Make sure you have installed a proper version of Minikube. For your Ubuntu VM it should be
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube
It is not recommended to use VM inside VM to run minikube. Check this answer. Try to run minikube with no vm drivers.
minikube start --vm-driver=none
I have read on minikube issues, but can not find it right now.
HTH

Running Kubernetes Locally via minikube

I am working on openam deployment on Google cloud platform (GCP) and the OS is RHEL7.
I am facing issue while running minikube start.
[root#test ~]# minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
150.53 MB / 150.53 MB [============================================] 100.00% 0s
E0509 06:20:12.950109 16264 start.go:159] Error starting host: Error creating host: Error executing step: Running precreate checks.
: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.
Retrying.
E0509 06:20:12.951500 16264 start.go:165] Error starting host: Error creating host: Error executing step: Running precreate checks.
: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
I already installed virtualbox on RHEL.
I want to know how to enable VT-X on GCP?
Thanks
Ashish
You can use --vm-driver=none to run your minikube in cloud. This flag will run your minukube in Docker. You should have installed Docker first.
Also you can create a custom image where VMX will be enabled. Just follow the official documentation instruction.
Example from the documentation on how to create a custom image with enabled VMX:
gcloud compute images create nested-vm-image --source-disk disk1 --source-disk-zone us-central1-a --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
Then, just create a new VM with the custom image.
gcloud compute instances create example-nested-vm --zone us-central1-b --image nested-vm-image
After all, you can install the VirtualBox or KVM and start minikube.