I am trying to run minikube
on my local machine and get an error from kubectl
.
The error message is: Unable to connect to the server: dial tcp 192.168.2.15:8443: connectex: No connection could be made because the target machine actively refused it.
Please see screenshot below.
I have tried all recommendations in Unable to run Kubernetes (kubectl) and Minikube on windows 10. Unable to connect to the server: dial tcp [::1]:8080: connectex: without any luck.
Any ideas for a fix?
UPDATE:
kubernetes-cli/kubectl
using Chocolateyminikube-installer.exe
and ran itStarted cluster with
minikube start --vm-driver hyperv --hyperv-virtual-switch "myswitch"
After connection issue I tried:
Output from minikube status
and minikube ip
:
I hardly see any issues with your steps. If your IP address is 192.168.2.xxx, then everything should be fine. You have an external Virtual Switch, you installed minikube with Choco which is working out of the box, and you used the correct commands to start the minikube.
The only thing that seems suspicious is your step 4:
- Downloaded minikube-installer.exe and ran it
In some cases, this part can cause some conflicts, but be aware that this is just a guess based on experience. My advice is to remove the minikube completely and to try again. We will try to troubleshoot further if the problem persists. I've written an answer in which I explained all the steps on how to do it on Windows (out of my personal experience) in this topic, and here are the steps:
minikube-installer.exe
from 'add/remove programs'minikube stop
, minikube delete
does not work so you might have to turn off the minikubeVM in Hyper-V manually, then go to c:\users\%username%** and delete **.kube and .minikube.cuninst minikube
choco install minikube
choco install kubernetes-cli
Hopefully, this will help, as those are the steps I use when there is anything wrong with my minikube (tested on several Windows laptops).