Installation & Setup
Everything runs on minikube. You do not need a cloud account or a production cluster.
Prerequisites
Section titled “Prerequisites”| Tool | Minimum Version | Install |
|---|---|---|
| Minikube | v1.32+ | brew install minikube or docs |
| kubectl | v1.28+ | brew install kubectl |
| Helm | v3.13+ | brew install helm |
| Docker or Podman | Latest | brew install podman |
Some labs have additional requirements noted in their own page.
Optional but recommended
Section titled “Optional but recommended”| Tool | Purpose | Install |
|---|---|---|
| Task | Run labs with task demo -- simple-app | brew install go-task |
| jq | Parse JSON output from kubectl | brew install jq |
| k9s | Terminal-based cluster UI | brew install k9s |
Minimum Resources
Section titled “Minimum Resources”| Resource | Minimum | Recommended |
|---|---|---|
| CPU cores | 4 | 6+ |
| RAM | 8 GB | 12+ GB |
| Disk | 20 GB | 40 GB |
You do not need all resources at once. Each lab is self-contained. Clean up one lab before starting another if your machine is constrained.
Start Minikube
Section titled “Start Minikube”minikube start \ --cpus=4 \ --memory=8192 \ --disk-size=40g \ --driver=dockerIf you use Podman, pass --driver=podman instead.
For heavier labs (Prometheus, CloudNativePG, Redis, real-world demos), consider allocating more memory:
minikube start --cpus=6 --memory=12288 --disk-size=40gVerify the cluster
Section titled “Verify the cluster”kubectl cluster-infokubectl get nodesYou should see a single node in Ready state.
Enable Required Addons
Section titled “Enable Required Addons”Most labs benefit from these addons. Enable them once after starting minikube:
minikube addons enable ingressminikube addons enable metrics-serverThe ingress addon provides an nginx ingress controller. The metrics-server addon is required for the HPA lab and any lab that uses kubectl top.
Accessing Services
Section titled “Accessing Services”Minikube provides several ways to reach services running inside the cluster:
# Option 1: minikube service (opens browser)minikube service <service-name> -n <namespace>
# Option 2: port-forwardkubectl port-forward svc/<service-name> <local-port>:<service-port> -n <namespace>
# Option 3: minikube tunnel (for LoadBalancer services)minikube tunnelClone the Repository
Section titled “Clone the Repository”git clone https://github.com/savitojs/k8s-learn-by-doing.gitcd k8s-learn-by-doingAll lab manifests live in the demos/ directory. Each lab is self-contained.
Using Taskfile (Optional)
Section titled “Using Taskfile (Optional)”If you installed Task, you can run labs with a single command:
# Deploy a labtask demo -- simple-app
# Clean up a labtask clean -- simple-app
# List all labstask list
# Check prerequisitestask prereqsThe -- separator is required because Task passes everything after it as CLI_ARGS.
You can also run labs manually with kubectl. Every lab README shows the raw kubectl commands.
Real-World Labs
Section titled “Real-World Labs”The real-world labs run multi-service architectures (Kafka, EFK, microservices, service mesh). They consume significantly more resources than the concept labs.
Before running a real-world lab:
- Clean up any running labs first:
task clean:all - Allocate at least 6 CPUs and 12GB RAM to minikube
- Check each lab’s page for its specific resource requirements
- Only run one real-world lab at a time unless you have 16GB+ RAM available
Cleanup
Section titled “Cleanup”When you are done with all labs:
minikube deleteTo clean up a single lab, follow the cleanup section on that lab’s page.
Next Step
Section titled “Next Step”Ready to go? Head to Your First Lab and deploy your first application.