srigu
srigu

Reputation: 505

Kubernetes on Windows Error: Unable to connect to the server: dial tcp some ip

I have downloaded Docker and then enabled Kubernetes on the Desktop. When I execute 'Kubectl version' command on the PowerShell it says:

kubectl : Unable to connect to the server: dial tcp : connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. At line:1 char:1

Upvotes: 2

Views: 8068

Answers (2)

agmar
agmar

Reputation: 21

The same issue I've had encountered just today and I found the solution the same day.

Here's the solution to my problem:

  1. I pressed right-click on my Docker icon at the taskbar.
  2. I changed the cluster that my k8s is pointing at from the 'gke_regal-hybrid' to 'docker-desktop' (in your case, must be different) and I was able to rerun the commands without any problems anymore.

Click this for image reference

Upvotes: 2

Dzmitry Paulouski
Dzmitry Paulouski

Reputation: 43

The same issue started to occur today when I run anything related to kubectl on Windows. However, it previously worked fine. Maybe there are some recent updates in Windows/Docker.

UPD

Actually, my network sharing options were reset for some reasons. Please try the solution described below (works for me)

SOLUTION:

Check your Network and Sharing settings:

Control Panel > Network and Sharing > [YOUR_NETWORK] (For me it's my Wi-Fi connection) > Properties > Sharing

On the Sharing tab make sure that you have all checkboxes checked and that you selected the correct virtual network in the "Home network connection" field. If not, please use the correct one.

Upvotes: 1

Related Questions