Enabling kubernetes on docker-desktop kubectl is missing


When enabling kubernetes support in docker-desktop kubectl is not installed.

Setup :
docker-desktop v4.13.1 on Pop OS 22.04
I installed docker-desktop using the deb file from the docker website.
Docker desktop runs just fine on this configuration. And enabling kubernetes seems to work. However after enabling kubernetes, the kubectl binary is not available from the command line.

Ive noticed when installing docker-desktop v4.13.1 on other OS’s (Mac OS Ventura, Windows 11), enabling kubernetes in docker-desktop also provides kubectl.

Do I have to install kubectl separately on linux platforms or is there something im missing here?

Did you open a new terminal after you enabled Kubernetes? On macOS, kubectl is at /usr/local/bin/kubectl.
As far as I know, Docker Desktop for Linux doesn’t support Pop OS. IT is based on Ubuntu, but it is not Ubuntu. If the above path is not in the PATH variable on Pop, you will not be able to use kubectl without using an absolute path when you run it.

So first, check the if the executable is there, add /usr/local/bin to the PATH variable and then make sure you open a new terminal and try again.

Thanks for the quick response. I checked /usr/local/bin and dont see any reference to kubectl.
I see a docker binary, and com.docker.cli symlinked back to /usr/bin/docker

Id like to dig into this further. For docker desktop on linux, what are the offically supported distros? Im thinking of creating a vm and trying to recreate on an offically supported distro.

FWIW I did download the latest version of kubectl from the kubernetes site as outlined here Install and Set Up kubectl on Linux | Kubernetes

Running “kubectl get nodes” does get node information for the cluster managed by docker desktop. So it looks like the config file in the .kube folder is populated correctly. Its just that kubectl doesnt get downloaded and installed.

Supported platforms: https://docs.docker.com/desktop/install/linux-install/#supported-platforms

If you do that, you need nested virtualization, since Docker Desktop will create a virtual machine. It is mentioned in the documentation too: https://docs.docker.com/desktop/install/linux-install/#system-requirements

Ok, today I tried a fresh install of ubuntu 22.04.1 with docker desktop 4.13.1 on a physical machine.
I made sure before installing docker desktop that ubuntu had all its updates. I did NOT update to 22.10, sticking to LTS instead.

Same result. After enabling kubernetes in docker-desktop, the kubectl command is not found and is NOT located under /usr/local/bin.



I opened an issue on the docker-desktop for linux github repo and it looks like kubectl is not installed by default with linux. Guidance is to install kubectl separately

kubectl is not available after enabling kubernetes in docker-desktop · Issue #93 · docker/desktop-linux (github.com)

1 Like

Thank you for the link! I didn’t know about that. I use Docker Desktop only on Windows and MacOS. Mainly on MacOS. On Linux, I just run Docker natively and download the kubectl binary for different Kubernetes versions instead of using the package manager.

They could probably do what Rancher Desktop does and add an option to decide whether you want to add the new kubectl to the PATH or not.