DEV Community

Cover image for Setting Up Kubernetes on Windows with Minikube (Step-by-Step Guide)
Abhishek Korde
Abhishek Korde

Posted on

Setting Up Kubernetes on Windows with Minikube (Step-by-Step Guide)

🌀 Prerequisites: Kubernetes, Docker, Containers, Cloud
There are many tools for managing the cluster in kubernetes:

  • Minikube → Local dev cluster (single-node).
  • Kind (Kubernetes in Docker) → Lightweight, fast local clusters in Docker containers.
  • k3s → Lightweight Kubernetes distribution for edge/IoT.
  • Kops → Production cluster provisioning (mostly AWS).
  • Kubadm → Official tool to bootstrap a Kubernetes cluster (often used for bare-metal or custom setup).
  • Rancher → GUI and management for multiple Kubernetes clusters.
  • OpenShift → Red Hat’s enterprise Kubernetes platform.
  • Managed services → EKS (AWS), GKE (Google Cloud), AKS (Azure).

Some of them are used for production, while others are mainly for local development.
Today, we are using minikub(obviously) for our local development.

Step 1: Install Minikube
The first step is to install Minikube using the link below, or by searching “Minikube install” in your browser.
link of installing the minikube:Minikube Install


Step 2: Install kubectl
The next step is to install kubectl. kubectl is the command-line tool for Kubernetes, and it allows us to interact directly with the cluster.
To install kubectl you can use below link or directly search in browser as kubectl install.
link for installing the kubectl:Kubectl Install
Choose the installation instructions for your platform (Linux, macOS, or Windows).


Step 3: Install Docker Desktop

  • Minikube runs the Kubernetes cluster inside a Docker container (when you use the --driver=docker).
  • You can install Docker Desktop either from the official website (browser download) or from the Microsoft Store.
  • Docker Desktop is a free platform (but not fully open source).
  • If your system does not support Hyper-V, you can use WSL2 as the backend for Docker.
  • In Docker Desktop → Settings → Resources → WSL Integration → Clicking “Refetch distros” helps Docker detect available Linux distributions.
  • If no distro is listed, you need to install a Linux distro like Ubuntu from the Microsoft Store (or manually).

Step 4: Start Minikube
Now that the basic setup is complete, we can create the Kubernetes cluster using the command below:

minikube start
Enter fullscreen mode Exit fullscreen mode

This creates a single-node Kubernetes cluster.
On Windows, instead of VirtualBox/Hyper-V, it runs inside Docker containers.

⚠️ Sometimes, Minikube fails because it pulls images from registry.k8s.io. Use a faster mirror:
In this case, use the following command:

minikube start --driver=docker --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

Enter fullscreen mode Exit fullscreen mode

This flag tells Minikube to use the Alibaba Cloud mirror instead, which is often faster and more reliable.


Step 5: Verify the Cluster
To list all Pods in the cluster (including system Pods), use the command:

kubectl get pods -A
Enter fullscreen mode Exit fullscreen mode

It will show like this.

These are the default system pods that Minikube runs inside the kube-system namespace:

  • coredns → Handles DNS (service discovery inside the cluster).
  • etcd-minikube → Key-value database that stores the entire Kubernetes cluster state.
  • kube-apiserver-minikube → The main API server; all kubectl commands talk to this.
  • kube-controller-manager-minikube → Ensures desired state (like creating pods if one fails).
  • kube-proxy → Manages networking rules for pod-to-pod and pod-to-service communication.
  • kube-scheduler → Assigns new pods to nodes.
  • storage-provisioner → Automatically provisions storage volumes when needed.

✅ All are in Running status → means your Minikube cluster is healthy and ready to run workloads.

To get all the nodes in your cluster and their status using below command:

kubectl get nodes
Enter fullscreen mode Exit fullscreen mode

The output of the above command looks like this:

  • NAME → minikube → This is your Kubernetes node (a VM/Container created by Minikube).
  • STATUS → Ready → The node is healthy and can run pods.
  • ROLES → control-plane → This node acts as the master/control plane (manages the cluster).
  • AGE → 5m3s → Node has been running for about 5 minutes.
  • VERSION → v1.34.0 → The Kubernetes version running on this node. âś… In short → Your Minikube cluster has 1 control-plane node, it’s healthy, and ready to schedule pods. After confirming that our nodes are up and running.

Step 6: What is a Pod?
Now we have to install pod. Inside that pod our application will run.

First, let’s understand what a Pod is.?

  • A Pod is the smallest deployable unit in Kubernetes.
  • A Pod is essentially a definition of how to run one or more containers.
  • The specification is written in a YAML manifest (like pod.yml), similar to how you give instructions in docker run.
  • Most Pods contain a single container, but sometimes Pods have:
  • Sidecar containers (for logging, monitoring, etc.).
  • Init containers (run before the main container).
  • Kubernetes assigns an IP address to the Pod, not to each individual container. All containers in the Pod share the same Pod IP and network namespace.

Step 7: Deploy Your First Application (Nginx)
We will now deploy our first Nginx application. The first step is to create a Pod by writing a pod.yml file.
As I told earlier pod is basically yaml file so we will write first basic yaml file that will help to understand the structure.
If you are on Windows, use the following command and paste the given YAML script:

notepad pod.yml
Enter fullscreen mode Exit fullscreen mode

because vi does not work on Windows (it is available only on Linux systems).

apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
    ports:
    - containerPort: 80

Enter fullscreen mode Exit fullscreen mode

🔎 In short:

You’re creating a Pod called nginx.
Inside it, you run 1 container using the image nginx:1.14.2.
That container exposes port 80 (default HTTP port).
âś… This YAML defines the smallest deployable unit in Kubernetes (a Pod) running Nginx.
After writing yml file we have to create application on pod using give command:

kubectl create -f pod.yml
Enter fullscreen mode Exit fullscreen mode

After creating the application, check whether it is running using the following command:

kubectl get pods
Enter fullscreen mode Exit fullscreen mode

and If we want to get entire details of pods with IP address of pod then use below command:

kubectl get pods -o wide
Enter fullscreen mode Exit fullscreen mode


Step 8: Access the Minikube Cluster
If you want to log in to the cluster where the application is running, use the command:

minikube ssh
Enter fullscreen mode Exit fullscreen mode
  • It opens an SSH session into the VM / Docker container that Minikube created to run your Kubernetes cluster.
  • This lets you log in directly inside the Minikube node (the machine acting as your Kubernetes cluster).

đź›  What you can do inside:

  • Run Linux commands (because Minikube runs on a Linux environment).
  • Check processes, logs, or system info.
  • Use tools like docker ps (to see the containers Kubernetes is running internally).
  • Troubleshoot networking or storage inside the cluster.  After that, test if the Pod’s internal IP is reachable and serving traffic by using curl .
curl <POD_IP>
Enter fullscreen mode Exit fullscreen mode

This ip address of pod where your application is running.

If you see the Nginx welcome page, 🎉 congratulations—your app is running successfully!


âś… Conclusion
You now have:

  • Minikube installed locally.
  • kubectl configured to interact with your cluster.
  • A working Nginx Pod running in Kubernetes. This setup is perfect for learning and local development before moving on to production tools like Kops, EKS, GKE, or AKS.

✨ Polished version:

To explore all commonly used kubectl commands, refer to the official Kubernetes cheatsheet:
Kubectl sheet sheet

Top comments (0)