Run Kubernetes on Windows
Recently Docker announced an experimental feature on their Windows App, that allows us to run Kubernetes on Windows Linux Subsystem. Here’s a high-level overview of how to do it:
-
Install WSL2 by following the official installation guide.
WSL 2 is a new version of the architecture in WSL that changes how Linux distributions interact with Windows
If you are like me and try to use the Windows Store to install WSL, you end up with the first version of WSL installed. I had to join the Windows Insider Program, update my windows version, and follow the steps to Update from WSL 1 to WSL 2.
-
Install Docker desktop for windows by following the official installation guide
-
Enable the WSL2 based engine on the settings:
-
Enable Kubernetes
-
Open the terminal on the Linux subsystem and install kubectl.
1 2 3
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \ && chmod +x ./kubectl \ && sudo mv ./kubectl /usr/local/bin/kubectl
-
Get the configuration for the Kubernetes cluster from the Windows file system