I'm running Docker Desktop for Windows with WSL2 integration. I'm also running minikube. The Docker Desktop GUI correctly shows both known contexts:
I've selected the 'minikube' context because that's the one I want to use.
However when I go into the WSL terminal and run kubectl config get-contexts, I can only see the docker-desktop context, which is the active one:
admin@RODDY01-PC:/mnt/c/workspace$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* docker-desktop docker-desktop docker-desktop
Running which kubectl reveals that I'm using the kubectl that docker-desktop installed when doing the WSL integration:
admin@RODDY01-PC:/mnt/c/workspace$ which kubectl
/usr/local/bin/kubectl
admin@RODDY01-PC:/mnt/c/workspace$ ls -la /usr/local/bin/kubectl
lrwxrwxrwx 1 root root 55 Aug 1 17:49 /usr/local/bin/kubectl -> /mnt/wsl/docker-desktop/cli-tools/usr/local/bin/kubectl
(In Windows, where kubectl is bundled as part of docker at C:\Program Files\Docker\Docker\resources\bin\kubectl.exe, it correctly shows both contexts and indicates minikube is the active; it's just the Linux/WSL2 kubectl instance that's not updating/recognizing the active and available contexts.)
How can I get Docker Desktop to properly update the kubectl active context in WSL2?
Version info: Docker Desktop 3.5.2; Windows 10 Professional; Debian 10 on WSL2.
