Kubernetes Setting Up the Lab
You cannot learn swimming by reading a book. You have to jump into the water. Similarly, you cannot learn Kubernetes just by reading. You need a cluster.
Install kubectl to communicate with Kubernetes API.
the three most effective ways to install kubectl on Windows, ranked from easiest to most manual.
Winget (Recommended)
If you are on Windows 10 or 11, you likely already have the Windows Package Manager (winget) installed. This is the cleanest method as it handles the PATH setup automatically.
- Open Command Prompt or PowerShell.
- Run the following command:
winget install -e --id Kubernetes.kubectl - Restart your terminal to ensure the path changes take effect.
Chocolatey or Scoop
If you are a developer who already uses a 3rd-party package manager, use the specific commands below.
- Chocolatey:
choco install kubernetes-cli - Scoop:
scoop install kubectl
Manual Binary (The “Old School” Way)
Use this if you cannot use package managers or need a specific version.
- Download: Download the latest stable release (v1.32.0 as of early 2026) directly: Download Kubernetes and save the exe file in system32 folder
- or Move: Create a folder (e.g.,
C:\k8s) and move the downloadedkubectl.exefile there. - Add to PATH:
- Press
Winkey, type “Env”, and select Edit the system environment variables. - Click Environment Variables.
- Under System variables, find the Path row and click Edit.
- Click New and paste the path to your folder (e.g.,
C:\k8s). - Click OK on all windows.
- Press
Verification
Regardless of the method used, verify the installation by opening a new terminal window and running:
kubectl version --client
# It will show Kubectl version.
we will set up a Kubernetes Lab. You have two options:
- Local Lab: Free, runs on your laptop. Best for learning.
- Online Learning Setup:
- Cloud Lab: Real production environment (AWS/GCP). Costs money, but you need to know this for jobs.
Local Setup: The Battle of Tools
Years ago, setting up Kubernetes locally was a nightmare. Now, it is just one command. But which tool should you use?
Minikube (The Classic)
By creating a virtual machine (VM) or a container on your laptop, it spins up a cluster where the Master (Control Plane) and the Worker (Node) are the same machine. This makes it perfect for learning, testing, and developing applications before pushing them to a real cloud environment.
| Feature | Description |
| Architecture | Single-node cluster (Control Plane + Worker on one node). |
| Isolation | High. It runs inside a VM (VirtualBox, KVM) or a Container (Docker, Podman). |
| Resource Usage | High. It reserves a chunk of your RAM/CPU exclusively for the VM. |
| Best For | Absolute beginners, testing specific K8s versions, and users who want a GUI (Dashboard). |
| Networking | Uses a bridge network; NodePort requires minikube service or tunnel to access. |
Quick Commands:
minikube start: Creates and starts the cluster.minikube dashboard: Opens the web-based GUI.minikube pause: Pauses the VM to save battery/RAM without deleting the cluster.minikube tunnel: Creates a network route to expose LoadBalancer services to your host.
–
kind (Kubernetes in Docker)
Kind (which stands for Kubernetes inDocker) is a tool that allows you to run Kubernetes clusters using Docker containers as “nodes.” Instead of creating heavy Virtual Machines (VMs) like Minikube does, Kind tricks your computer into thinking a simple Docker container is a full-blown server. Because containers are light, Kind is blazing fast.
- Container-based Nodes: The Master and Worker nodes are just Docker containers running on your laptop.
- Multi-Node Support: Unlike Minikube (which struggles with this), Kind can easily simulate a 3-node or 5-node cluster on a single laptop.
- CI/CD Friendly: Because it is just a container, it is very easy to run Kind inside a Jenkins or GitHub Actions pipeline.
| Feature | Description |
| Technology | Runs K8s nodes inside Docker containers (nested architecture). |
| Startup Time | Lightning Fast (30–60 seconds). |
| Resource Usage | Low. Shares the host kernel; no heavy VM overhead. |
| Networking | Uses Docker bridge network; requires port mapping for external access. |
| Best For | CI/CD, testing multi-node setups, and developers who already use Docker. |
| Image Handling | No registry needed! Sideload images using kind load docker-image. |
Kind is more than just a toy; it is a compliant K8s distribution.
- CNI (Container Network Interface): By default, Kind uses a simple CNI called
kindnetd. However, you can disable the default CNI during installation and install powerful ones like Calico or Cilium to test advanced network policies locally. - Ingress Controllers: Kind allows you to map ports from the Docker container to your localhost. This means you can run an NGINX Ingress Controller and access your apps via
localhost:80just like production. using MetalLB - HA Control Plane: You can configure Kind to run multiple control plane nodes. This is critical for testing High Availability (HA) scenarios and seeing how your application behaves if one master node “dies” (you can manually stop the Docker container to simulate a crash).
- StorageClass: It uses the
standardStorageClass which creates files on the node container. For data persistence on your actual laptop, you must useextraMountsin the config to mount a folder from your host OS into the Kind node.
–
k3d (The Lightweight Champion)
k3d runs k3s (a lightweight version of Kubernetes) inside Docker containers. It creates a “cluster” where every node is just a Docker container running the k3s software. It is incredibly fast and uses very little RAM, making it the best choice for developers with older laptops or those who want to run 5-6 clusters at the same time.
- Tiny Binary: The k3s binary inside the container is less than 100MB.
- Database Swap: By default, it often uses SQLite instead of the heavy etcd database (though you can switch to etcd).
- Docker-in-Docker: It relies on the Docker daemon on your host machine to run.
| Feature | Description |
| Core Engine | k3s (Lightweight K8s by Rancher). |
| Architecture | Runs k3s nodes as Docker containers. |
| Startup Time | Instant (5-15 seconds). |
| Resource Usage | Ultra Low. Can run on 512MB RAM! |
| Networking | Creates a Docker network; exposes ports to localhost easily (-p flag). |
| Best For | IoT development, CI/CD, old laptops (4GB RAM), Edge computing. |
| Default Ingress | Traefik comes pre-installed (can be disabled). |
Docker Desktop/Rancher Desktop/Podman Desktop:
Many popular desktop container tools have an option to enable a local Kubernetes cluster with a single click, providing the easiest path to a working environment if you already use these tools.
- Docker Desktop: Official Website
- Rancher Desktop: Official Website
- Podman Desktop: Official Website
MicroK8s:
MicroK8s is a “low-ops” Kubernetes. It packages all the complex components (API server, controller, scheduler, database) into a single package called a Snap. You don’t install them one by one; you just install the Snap, and it automatically sets up a production-ready cluster. It is famous for its “Add-on” system—you can enable complex tools like Istio or Prometheus with a single command, like flipping a light switch.
- A lightweight, fully-featured Kubernetes that installs with a single command and supports useful add-ons like Istio or Prometheus.
| Feature | Description |
| Core Engine | Upstream Kubernetes (unmodified) packaged as a Snap. |
| Database | Dqlite (High Availability SQLite) for clustering. |
| Installation | sudo snap install microk8s --classic |
| Command Prefix | Commands are prefixed: microk8s kubectl, microk8s ctr. |
| Add-ons | Built-in catalog (Istio, GPU, Knative) enabled via CLI. |
| Best For | Ubuntu users, Edge devices, production IoT, and quick “batteries-included” setups. |
Web Based Kubernetes Learning
Killercoda and Play with Kubernetes (PWK) are the “Cyber Cafés” of the Kubernetes world. They give you a temporary, fully working Kubernetes cluster right inside your web browser. You don’t need to install anything, you don’t use your own RAM/CPU, and if you break the cluster, you just close the tab and open a new one. It is the safest, zero-risk way to learn.
Browser-based environments that give you instant, temporary access to a Kubernetes cluster without local installation.
- Killercoda provides interactive Kubernetes scenarios and a playground environment
- Play with Kubernetes gives you a temporary Kubernetes cluster in your browser
| Feature | Killercoda | Play with Kubernetes (PWK) |
| Type | Scenario-Based (Guided Lessons). | Sandbox (Empty Cluster). |
| Engine | Runs on real VMs (Ubuntu). | Runs on Docker-in-Docker (DinD). |
| Time Limit | Usually 60 minutes per scenario. | 4 hours per session. |
| Persistence | None. Data is wiped when timer ends. | None. Wiped after 4 hours. |
| Best For | CKA/CKS Exam prep, learning specific tools. | Testing multi-node setups, quick experiments. |
| Login | GitHub / Google / Email. | GitHub / Docker ID. |
Cloud Setup: The “Real” World
(EKS, GKE, AKS)
2. EKS (Amazon Elastic Kubernetes Service)
- AWS is the market leader. 70% of jobs ask for EKS.
- Cost: Not Free. The Control Plane costs ~$0.10/hour (~$72/month) even if you don’t run any pods!
- Warning: Be careful with EKS labs. Turn them off immediately after use.
- eksctl.io
1. GKE (Google Kubernetes Engine)
- Google invented Kubernetes. GKE is the smartest, fastest, and most automated version.
- Free Tier: Google gives $300 free credit for 90 days. GKE management fee is often free for one zonal cluster.
- Best for: Learning the “pure” Kubernetes experience.
- Google Cloud SDK
3. AKS (Azure Kubernetes Service)
- Why: Microsoft Enterprise favorites.
- Cost: The Control Plane is Free! You only pay for the worker nodes (VMs).
- Best for: Budget-conscious learners who want a real cloud experience.
- Azure CLI
| Feature | GKE (Google) | EKS (AWS) | AKS (Azure) |
| Control Plane Cost | Free (for one zonal cluster/month). | **~$0.10/hour** (~$72/month). | Free (Standard tier). |
| Worker Nodes | Pay for EC2/Compute Engine VMs. | Pay for EC2 instances. | Pay for Virtual Machines. |
| Upgrades | Fully Automated (safest). | Manual / Semi-Automated. | Automated options available. |
| CLI Tool | gcloud | aws / eksctl | az |
| Best For | Learning, “Pure” K8s, AI/ML workloads. | Getting Hired (Market Share), Production. | Enterprise, Windows Containers, Cost-savings. |
This is a complete, copy-paste-ready guide formatted for a blog post or technical documentation page. It covers setting up an EKS cluster with Spot Instances and configuring IAM access for specific users.
Create an EKS Cluster
with Spot Instances & IAM Access using Terraform
This guide provides a complete, step-by-step walkthrough to provision a production-ready Amazon EKS cluster. We will use Spot Instances to save up to 90% on compute costs and configure IAM Access Entries so specific users can manage the cluster.
Prerequisites
Before starting, ensure you have the following installed:
- Terraform (v1.0+)
- AWS CLI (configured with
aws configure)- Get AWS Access and Secret key and configure on your local machine
- kubectl (to interact with the cluster)
Clone the Terraform Code to Create EKS cluster
git clone https://github.com/Rajkumar-Aute/Create-an-EKS-Cluster-Lab.git cd Create-an-EKS-Cluster-Lab/
–
How to Deploy
Open your terminal in the project folder and run the following commands.
Step 1: Initialize
Download the required provider plugins.
terraform init
Step 2: Plan
Review what Terraform intends to create.
# Basic plan (Only you get access) terraform plan
Step 3: Apply
Create the infrastructure. (This takes about 15 minutes).
terraform apply -auto-approve
3. How to Connect & Verify
Once the apply command finishes, Terraform will output a configuration command.
Step 1: Configure kubectl
Run the command provided in the output:
aws aws eks --region us-east-1 update-kubeconfig --name "kubernetes-cluster"
Note: This updates your ~/.kube/config file to use the credentials of the active AWS CLI user.
Step 2: Verify Nodes
Check if your Spot Instances are running and registered.
kubectl get nodes --label-columns=eks.amazonaws.com/capacityType
Expected Output:
NAME STATUS ROLES AGE VERSION CAPACITYTYPE ip-10-0-1-xxx.ec2.internal Ready <none> 5m v1.31.0-eks-abcde SPOT ip-10-0-2-xxx.ec2.internal Ready <none> 5m v1.31.0-eks-abcde SPOT
Step 3: Verify IAM User Access
If you added an additional user via the admin_user_arn variable, ask that user to run:
# They must configure their CLI first aws configure # Then update their kubeconfig aws eks --region us-east-1 update-kubeconfig --name "kubernetes-cluster" # Then test access kubectl auth can-i "*" "*"
If configured correctly, the output will be yes.
Learn and Practice Kubernetes on AWS EKS, all the commands
Cleanup
To delete the cluster and stop incurring costs:
terraform destroy -auto-approve
⚠️ Cost Warning:
Always run
terraform destroywhen you are done practicing! If you leave a cluster running, the cloud provider will charge you money even while you sleep.