Kubernetes on Windows: 6 Life-Saving Tools & Tips

A black keyboard with a Windows key

What’s Different About Using Windows for Kubernetes?

Before diving into the details, let’s discuss what exactly makes running a Kubernetes cluster on Windows a challenge.

Tools and Tips for Running Kubernetes on Windows

Now that you know what you’re facing, let’s get into the tools and techniques that can help you as a developer to run Kubernetes on Windows smoothly.

1. Native Linux Commands with WSL

WSL allows you to run native Linux commands on Windows without setting up a virtual machine. WSL is a path-breaking functionality introduced in Windows by Microsoft, which makes the developer’s life easy.

2. Docker Desktop on Windows

Docker Desktop on Windows provides you with the option to create a single node functional Kubernetes cluster on your Windows workstation.

  • Windows 10, updated to version 2004, Build 1903, or higher
  • Verify whether WSL is enabled or not by using the Turn Windows features on or off feature. Make sure that Windows Subsystem for Linux feature is turned on as shown in the following screenshot.
  • Engine running
  • Kubernetes running
PS C:\Users\ac> kubectl get all
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 2m36s
PS C:\Users\ac> kubectl get node
NAME STATUS ROLES AGE VERSION
docker-desktop Ready control-plane,master 3m12s v1.21.5

3. Rancher Desktop

Rancher Desktop is an open-source desktop application for Kubernetes and container management with support for macOS and Windows.

4. kind

Another Kubernetes SIGs project for running it locally, kind is short for Kubernetes in Docker. Instead of spawning a VM, you can run Kubernetes as a bunch of Docker containers. You get faster startup time with kind compared with minikube.

PS C:\WINDOWS\system32> choco install kind -y
Chocolatey v0.10.15
Installing the following packages:
kind
By installing you accept licenses for the packages.
Progress: Downloading kind 0.11.1... 100%

kind v0.11.1 [Approved]
kind package files install completed. Performing other installation steps.
Downloading kind 64 bit
from 'https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-windows-amd64'
Progress: 100% - Completed download of C:\ProgramData\chocolatey\lib\kind\kind.exe (6.58 MB).
Download of kind.exe (6.58 MB) completed.
Hashes match.
ShimGen has successfully created a shim for kind.exe
The install of kind was successful.
PS C:\WINDOWS\system32> kind create cluster
Creating cluster "kind" ...
• Ensuring node image (kindest/node:v1.21.1) 🖼 ...
✓ Ensuring node image (kindest/node:v1.21.1) 🖼
• Preparing nodes 📦 ...
✓ Preparing nodes 📦
• Writing configuration 📜 ...
✓ Writing configuration 📜
• Starting control-plane 🕹️ ...
✓ Starting control-plane 🕹️
• Installing CNI 🔌 ...
✓ Installing CNI 🔌
• Installing StorageClass 💾 ...
✓ Installing StorageClass 💾
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Thanks for using kind! 😊
PS C:\WINDOWS\system32> kubectl get nodes
NAME STATUS ROLES AGE VERSION
kind-control-plane Ready control-plane,master 27m v1.21.1

5. minikube

minikube is the most popular option for running the local Kubernetes cluster for the following reasons:

  • It can be deployed on VM, bare metal, or as a Docker container.
  • It supports different container runtimes(Docker, containerd, etc.).
  • It has out-of-the-box support for a Kubernetes dashboard and load balancing.
  • It supports various VM drivers.
PS C:\WINDOWS\system32> choco install minikube
Chocolatey v0.10.15
Installing the following packages:
minikube
By installing you accept licenses for the packages.
Progress: Downloading kubernetes-cli 1.22.2... 100%
Progress: Downloading Minikube 1.23.2... 100%
.................
Minikube v1.23.2 [Approved]
minikube package files install completed. Performing other installation steps.
ShimGen has successfully created a shim for minikube.exe
The install of minikube was successful.
PS C:\WINDOWS\system32> minikube start --driver=docker
* minikube v1.23.2 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
* Using the docker driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
> gcr.io/k8s-minikube/kicbase: 355.40 MiB / 355.40 MiB 100.00% 3.32 MiB p/
* Creating docker container (CPUs=2, Memory=2200MB) ...
* Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
- Generating certificates and keys ...
- Booting up control plane ...
- Configuring RBAC rules ...
* Verifying Kubernetes components...
- Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
PS C:\WINDOWS\system32> kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane,master 7m57s v1.22.2

6. Lens

Lens is an open-source desktop application for macOS, Windows, and Linux that allows you to manage your Kubernetes cluster. You can download it for Windows here, and use it to view and manage the state of your Kubernetes clusters. It provides features like managing multiple clusters, support for various Kubernetes distributions, easy debugging, and support for managing Helm Charts, to name a few.

Conclusion

The Windows subsystem for Linux helps bridge the gap between Windows and Linux. With tools like Docker Desktop, minikube, kind, and Rancher Desktop, running a Kubernetes cluster locally on Windows can still be a smooth experience.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Loft Labs

Loft Labs

637 Followers

>> www.loft.sh << Build Your Internal Kubernetes Platform With Virtual Clusters, Namespace Self-Service & Secure Multi-Tenancy