Search code examples
kubernetesminikubek3d

Kubectl error : [memcache.go:265] couldn't get current server API group list


I'm new to Kubernetes and I'm trying to set up a local cluster using k3d. Here are the steps I've taken:

  • Installed k3d and kubectl.
  • Created a cluster using k3d cluster create -a 2.
  • Switched to the cluster context using kubectl config use-context k3d-k3s-default. However, when I run kubectl cluster-info to check the connection to the cluster, I encounter the following error:
couldn't get current server API group list: Get "https://host.docker.internal:55345/api?timeout=32s": dial tcp 192.168.1.24:55345: 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.

I'm unsure how to resolve this issue. Can anyone help me understand what might be causing this error and how to fix it? Thank you in advance!


Solution

  • This happens usually because of dns or networking. The issue is with the host.docker.internal. you can change host.docker.internal to 127.0.0.1 in $HOME/.kube/config, you can reach it. Or by creating a new cluster like

    k3d cluster create mycluster --api-port localhost:5443