0

I tried to install kubernetes with Docker desktop. However, as soon as I type in

kubectl get nodes

I get Remote kubernetes server unreachable error.

I0217 23:42:56.224000   26220 versioner.go:56] Remote kubernetes server unreachable
Unable to connect to the server: dial tcp 172.28.112.98:6443: 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.

Any ideas on how to fix this?

6
  • Are you abel to ping 172.28.112.98 ?
    – P....
    Commented Feb 17, 2022 at 23:06
  • Unfortunately, no.
    – Mark
    Commented Feb 18, 2022 at 8:28
  • 1
    Have you got more than one context? Check with "kubectl config get-contexts". If necessary change context using "kubectl config use-context docker-desktop"
    – Robin Webb
    Commented Feb 18, 2022 at 10:18
  • @RobinWebb That did it for me. Many thanks.
    – Mark
    Commented Feb 18, 2022 at 14:35
  • Hi @RobinWebb can you put your solution in an answer so it is more accessible to the community? Commented Feb 18, 2022 at 16:09

3 Answers 3

5

Have you got more than one context in your kubeconfig?

You can check this with kubectl config get-contexts.

If necessary change your context to Docker Desktop Kubernetes using kubectl config use-context docker-desktop.

Is it possible that you may have tried minikube and this has left cluster/context in your .kube\config?

Configure Access to Multiple Clusters

0

go to your HOME/.kube directory and check the config file. There is a possibility that the server mentioned there is old or not reachable.

you can copy the new config file(from remote server of the other directory of tools like k3s) and add/replace it in your HOME/.kube / config file.

-2

Same error message may also happen when you switch from local k8s cluster to a remote cluster that requires VPN to connect and you are not connected to VPN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.