Problem Description:
I encountered an issue with Docker where I received a request timeout error related to a file. Unfortunately, I don’t remember the exact file name, but it was something like com.docker.... While attempting to resolve this problem, I came across these commands and ran them:
brew uninstall --cask docker --force
brew uninstall --formula docker --force
After running these commands, Docker Desktop and kubectl were uninstalled from my system (I don't know why it uninstalled kubectl btw). I reinstalled Docker Desktop by downloading it from the official website and reinstalled kubectl using Homebrew. However, when I tried to connect to a remote Kubernetes cluster using my kubeconfig, I received the following error:
E0118 21:38:05.101621 80283 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
This happens with the kubeconfigs for all environments (test, stage, and production). The strange part is that the exact same kubeconfigs work perfectly when used in OpenLens, but they fail with kubectl.
What could be causing the kubeconfigs to work with OpenLens but not with kubectl? How can I resolve this issue?
This comment fixed the problem: