sobby01
sobby01

Reputation: 2154

Docker desktop - kubernetes failed to start

I have installed Docker Desktop (version : 2.3.0.4) and enabled Kubernetes. I deployed couple of PODS and everything was working fine, Since yesterday I am facing a weird issue mentioned below:

Unable to connect to the server: dial tcp 127.0.0.1:6443: connectex: No 
connection could be made because the target machine actively refused it.

As such, no changes were made on my system. I am using Linux Containers on Windows 10 machine.

Following steps I have tried:

  1. Restarted the Docker Desktop
  2. Tried the same with minikube and Docker Desktop both
  3. Tried to disable the firewall but due to some permissions, I am not able to turn it off.
  4. I have reset the kubernetes cluster as well.

Docker Desktop Error

Upvotes: 82

Views: 84930

Answers (16)

Check the Add the *.docker.internal names ... work for me enter image description here

Upvotes: 0

Sanjay Dwivedi
Sanjay Dwivedi

Reputation: 749

Got the same issue and perform series of activity like below but still same issue.

  1. Clean/Purge Data
  2. Reset to Factory default
  3. Reset Kubernetes Cluster

Issue was...

I forgot to verify email which had used for created docker account, so please check your email and very account and issue will be fixed.

Upvotes: 0

N-ate
N-ate

Reputation: 6926

I tried numerous changes to fix docker desktop Kubernetes failing to start. What finally worked:

Clicked the troubleshooting icon (it's a bug icon at the top right corner) and then chose Clean/Purge Data.*

Upvotes: 172

Imre Nagy
Imre Nagy

Reputation: 11

I had a working Kubernetes (k8s) cluster with Docker v4.20. However, after installing a series of Windows updates and updating Docker Desktop to v4.22, both Kubernetes and the Docker engine failed to start. I had to reinstall Docker Desktop to get the Docker engine running again. Unfortunately, neither the factory reset nor the "Clean/Purge data" options helped with Kubernetes. However, using the "Reset Kubernetes cluster" option resolved the problem.

Upvotes: 0

Mehran Khan
Mehran Khan

Reputation: 1165

  1. Disable/Stop any VPN
  2. From Docker Desktop Press Reset Kubernetes Cluster.

Note: #2 will remove any stack and data.

enter image description here

The above action will result this:

enter image description here

enter image description here

Upvotes: 0

EldarYarden
EldarYarden

Reputation: 91

My steps:

  1. restart docker - it didn't help.
  2. reset Kubernetes - it didn't help.
  3. Adding missing 'wslconfig' file to C:\Users[MY USER] - it didn't help.
  4. Restart the computer between any step - it didn't help.
  5. stop using Wsl reuse Wsl - it didn't help.
  6. uninstall docker and install again and enable Kubernetes - it didn't help.
  7. Remove '.kube' folder from C:\Users[MY USER] and reset Kubernetes - It causes the Kubernetes to try stopping, and after failure - restart docker - which succeeded.

Upvotes: 9

Saqib Shehzad
Saqib Shehzad

Reputation: 165

My docker-desktop is running behind the company proxy server. I deleted following Proxy Env Variables from my windows OS.

HTTPS_PROXY:serveraddess
HTTP_PROXY:serveraddress

and I set up manual proxy in docker desktop. enter image description here

Upvotes: 1

John Erbynn
John Erbynn

Reputation: 375

I don't know for others but for some reasons, the above suggested options didn't work for me while fixing K8s on Docker Desktop on Windows. Tried fixing by cleaning the cluster, resetting to default, restarting pc, installing previous versions of Docker Desktop, enabling my pc HiperVisor, and giving it more resource priority, and others but yet still K8s failed to start, even though the Docker starts.

I chanced on Minikube as an alternative tool (without UI) to create my cluster and interacted with it using Kubectl.

And K8s worked for me locally.

enter image description here

I followed this guide - https://minikube.sigs.k8s.io/docs/start/

Upvotes: 0

Gerrit Brouwer
Gerrit Brouwer

Reputation: 750

In my case, the corporate proxy server caused the Kubernetes startup to fail. Addiing *.docker.internal to the no_proxy hosts solved the issue.

Upvotes: 1

ThePravinDeshmukh
ThePravinDeshmukh

Reputation: 1913

I tried clean/purge data and resetting factory settings but that didn't worked.

I had to reset kubernetes cluster from here.

enter image description here

Upvotes: 20

Ramesh Reddy
Ramesh Reddy

Reputation: 55

Even I had similar problem after updating to Docker desktop(version 4.11.1). After I downgraded the version it works fine.

Troubleshooting steps

check is there any errors by running following command

kubectl get events|grep node

and make sure all pods are in running state.

kubectl get pods --namespace kube-system

Upvotes: -3

sareno
sareno

Reputation: 696

In my case, the Kubernetes (Docker Desktop on Mac) is not running properly though I can manage Pods, Services, etc., when I opened the Docker Desktop, it says

Kubernetes failed to start (red background)

I managed to fix the issue by resetting Docker Desktop and Prune/cleaning the storage.

Upvotes: 0

tom
tom

Reputation: 1493

For me, just "Clean and Purge" wasn't enough. Here is what I did.

  1. Log off VPN
  2. Go to bug and "Clean and Purge Data"
  3. Also choose "Reset to Factory Defaults"
  4. Restart Docker Desktop
  5. Choose "Enable Kubernetes"

At this point, the "Starting" took a while for Kubernetes to be enabled. Now's it all good.

$ kubectl get namespace
NAME              STATUS   AGE
default           Active   80s
kube-node-lease   Active   82s
kube-public       Active   82s
kube-system       Active   82s

Upvotes: 15

Ali Sherafat
Ali Sherafat

Reputation: 3855

As @N-ate mentioned above, after clicking Clean/Purge Data which removes all downloaded images from my computer, now docker and kubernates are running properly.
As you can see in the image below, I only have kubernates images running on docker and it takes most of the allocated memory. I guess the failure of starting kubernates was related to this memory issue. docker and kuber running image

Upvotes: 0

sibel kahraman
sibel kahraman

Reputation: 1

I had similar problem.

  • Install Minikube

I install minikube and I run as following on windows 10. starting of kubectl Then I gave permission for docker.

  • Check cluster-info

When I check cluster-info result as following cluster info results

  • Try to get pods

When I try to get pods I did not get any error.

Upvotes: 0

sobby01
sobby01

Reputation: 2154

Finally,I found the solution for this.

VPN was causing the issue, I am using my office laptop and after restart, VPN was enabled and logged-in and due to this Kubernetes was not working.

After disabling the VPN, Kubernetes cluster working fine.

pods

Hope that helps others as well.

Upvotes: 22

Related Questions