Running Kubernetes on Windows 10: A Comprehensive Guide
In the rapidly evolving world of container orchestration, Kubernetes has emerged as a powerful tool for automating deployment, scaling, and management of containerized applications. Traditionally associated with Linux-based systems, Kubernetes can also be run on Windows 10, thanks to the Windows Subsystem for Linux (WSL) and the Kubelet for Windows. This guide will walk you through the process of setting up and running Kubernetes on Windows 10.
Prerequisites
Before you begin, ensure you have the following prerequisites in place:
- Windows 10 Pro or Enterprise (version 1809 or later) with WSL 2 enabled.
- A user account with administrative privileges.
- Basic understanding of Kubernetes and Docker.
Setting Up Windows Subsystem for Linux 2 (WSL2)
WSL2 is a compatibility layer for running Linux binary executables natively on Windows 10. It enables you to run a full-fledged Linux environment—including most command-line tools, utilities, and applications—directly on Windows, unmodified.

To set up WSL2, follow these steps:
- Enable Virtual Machine and Windows Subsystem for Linux features in the Windows Features dialog box.
- Download and install a Linux distribution (e.g., Ubuntu) from the Microsoft Store.
- Update your package list and upgrade installed packages using the following commands:
wsl --update
wsl --set-default-version 2
Installing Docker Desktop for Windows
Docker Desktop for Windows provides a seamless experience for running Docker on Windows, including support for Kubernetes. To install Docker Desktop, follow these steps:
- Download the Docker Desktop installer from the official Docker website.
- Run the installer and follow the prompts. Ensure you select the option to install Kubernetes.
Setting Up the Kubernetes Cluster
Once Docker Desktop is installed, you can set up a local Kubernetes cluster using the following commands:

docker run -d -p 2379:2379 -p 6443:6443 -p 10250:10250 -p 10251:10251 -p 10252:10252 --restart=unless-stopped --name k3s-server k3s/k3s:latest
docker run -d --name k3s-agent --network host -v /var/run/docker.sock:/var/run/docker.sock -v /c/Users/<your-username>/.kube:/etc/kubernetes/admin.conf k3s/k3s:latest agent
Replace <your-username> with your Windows username.
Verifying the Kubernetes Cluster
To verify that your Kubernetes cluster is up and running, use the following command to check the node status:
kubectl get nodes
The output should display the status of your node as "Ready".

Deploying Your First Application
Now that your Kubernetes cluster is set up, you can deploy your first application using a Kubernetes manifest file. For example, to deploy the NGINX deployment, use the following command:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/cloud/deploy.yaml
Conclusion
In this guide, we've explored the process of setting up and running Kubernetes on Windows 10 using WSL2 and Docker Desktop. By following the steps outlined above, you can now take full advantage of Kubernetes' powerful container orchestration capabilities on your Windows machine.






















