DEV Community

MartinS984
MartinS984

Posted on

Tutorial: Build a Zero-Cost DevOps Platform on Windows 11 with Kubernetes & ArgoCD

Subtitle: A complete guide to running a production-grade DevSecOps stack locally using WSL2, Minikube, and Magic Domains.

๐Ÿ’ก Why This Matters
Learning DevOps often comes with a price tagโ€”AWS bills, managed clusters, and domain costs. But you don't need a credit card to simulate a production environment.

In this tutorial, you will build a complete GitOps Pipeline on your local machine. By the end, you will have:

Kubernetes Cluster (running inside WSL2).

GitOps Automation (ArgoCD syncing from GitHub).

Monitoring Stack (Prometheus & Grafana).

Real URLs (using Ingress & nip.ioโ€”no localhost hacks).

๐Ÿ“‹ Prerequisites
Before we start, ensure you have the following installed on Windows 11:

WSL2 (Ubuntu distribution recommended).

Docker Desktop (configured to use the WSL2 backend).

Minikube & Kubectl.

Helm (Package manager for Kubernetes).

Step 1: Initialize the Local Cloud
First, we need to spin up our cluster. We will use the Docker driver for stability and enable the Ingress addon immediately.

Start the cluster

minikube start --driver=docker
Enter fullscreen mode Exit fullscreen mode

Enable the Ingress Controller (This acts as our traffic police)

minikube addons enable ingress
Step 2: Install the GitOps Engine (ArgoCD)
We will use ArgoCD to watch a GitHub repository and automatically sync changes to our cluster.

The Challenge: SSL Loops
ArgoCD enforces HTTPS by default. When running behind a local Ingress controller, this often causes "Infinite Redirect" loops or 503 errors.

The Fix: Insecure Mode Patch
We will install ArgoCD and immediately patch it to run in "Insecure Mode," letting our Ingress controller handle the routing.

1. Create the namespace and install ArgoCD

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Enter fullscreen mode Exit fullscreen mode

2. Wait for pods to start

kubectl get pods -n argocd --watch
Enter fullscreen mode Exit fullscreen mode

3. PATCH: Disable internal SSL enforcement

kubectl patch deployment argocd-server -n argocd --type=json -p='[{"op": "add", "path": "/spec/template/spec/containers/0/command", "value": ["argocd-server", "--staticassets", "/shared/app", "--insecure"]}]'
Enter fullscreen mode Exit fullscreen mode

Step 3: Add Observability (Grafana)
A production cluster needs monitoring. We'll use Helm to install the industry-standard "Kube-Prometheus Stack."

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install monitoring prometheus-community/kube-prometheus-stack
Enter fullscreen mode Exit fullscreen mode

Step 4: The Networking Magic (nip.io)
This is the most critical part. Instead of editing your Windows hosts file for every new service, we use nip.io. This wild-card DNS service maps any domain containing an IP address back to that IP.

We configure our Kubernetes Ingress resources to listen on domains like:

argocd.127.0.0.1.nip.io

grafana.127.0.0.1.nip.io

This tricks your browser into thinking it's visiting a real website, while the traffic stays 100% local.

Step 5: The "Wide Open" Gateway
Finally, we bridge the gap between Windows (your browser) and Linux (the cluster). We use kubectl port-forward, but with a twist: the --address 0.0.0.0 flag.

Run this in a separate terminal and keep it open:

kubectl port-forward -n ingress-nginx svc/ingress-nginx-controller 8080:80 --address 0.0.0.0
Enter fullscreen mode Exit fullscreen mode

Pro Tip: This flag forces the port to listen on all network interfaces, ensuring Windows can "see" the Linux port.

๐Ÿš€ The Result
Open your browser. You now have access to a full suite of DevOps tools via clean, distinct URLs:

ArgoCD: http://argocd.127.0.0.1.nip.io:8080 (GitOps Dashboard)

Grafana: http://grafana.127.0.0.1.nip.io:8080 (Metrics)

Your App: http://node-app.127.0.0.1.nip.io:8080 (The workload)

๐Ÿ Conclusion
You have successfully built a zero-cost DevOps platform. You solved the complex networking issues of WSL2 using Ingress and nip.io, and you established a GitOps workflow with ArgoCD.

This setup allows you to test, break, and fix production-grade deployments without spending a dime on cloud providers.

Happy Coding!

Tags: #DevOps #Kubernetes #Tutorial #GitOps #Minikube #WSL2 #Engineering

๐Ÿ“‚ Get the Code: You can find the complete source code, including the Kubernetes manifests, ArgoCD config, and the nip.io ingress setup here: ๐Ÿ‘‰ https://github.com/MartinS984/node-devops-project

Top comments (0)