Guides
How to Install kubectl and kind (or minikube) on Linux, Mac and Windows
By Ravindra Bagale, DevOps trainer · LinkedIn · Published: · Last updated:
Install kubectl, start kind or minikube with Docker, verify current-context, then kubectl get nodes.
Friends, install the client first, then a tiny local cluster. Chala mitrano — always check current-context before apply.
मित्रांनो, आधी client, मग छोटा local cluster. Chala mitrano — apply आधी current-context तपासा.
मित्रों, पहले client, फिर छोटा local cluster। Chala mitrano — apply से पहले current-context जाँचें।
Quick answer
Hold this vertical picture:
- Install kubectl.
- Ensure Docker runs.
- kind create or minikube start.
- Check current-context.
- kubectl get nodes.
Language: English · मराठी · हिंदी
Local K8s lab
Why a local cluster
Practice without cloud bills or shared prod risk.
Why: First apply on prod is how outages start.
What: kind/minikube on your laptop.
How: Client first, then cluster tool.
Example 1: Check if kubectl exists
Type this:
command -v kubectl >/dev/null && kubectl version --client 2>/dev/null | head -1 || printf '%s\n' 'kubectl not installed yet'
You will see:
What it means: Client-only version works even without a cluster.
Example 2: Download pattern (no real URL host ban)
Type this:
printf '%s\n' 'Install kubectl from your OS package manager or the official Kubernetes release page for your arch'
You will see:
Install kubectl from your OS package manager or the official Kubernetes release page for your arch
What it means: Prefer distro packages when your company mirrors them.
Example 11: Windows note
Type this:
printf '%s\n' 'On Windows use WSL2 + Docker Desktop, then install kubectl and kind inside WSL'
You will see:
On Windows use WSL2 + Docker Desktop, then install kubectl and kind inside WSL
What it means: Git Bash alone is not enough for kind.
Concept 1: kind vs minikube
Both give a local API; pick team standard.
Why: Fighting tools wastes a week.
What: kind create or minikube start.
How: Docker must be healthy.
Example 3: kind version check
Type this:
command -v kind >/dev/null && kind version || printf '%s\n' 'kind not installed yet'
You will see:
What it means: kind runs a cluster inside Docker — great Infosys lab choice.
Example 4: kind create cluster command
Type this:
printf '%s\n' 'kind create cluster --name lab'
You will see:
kind create cluster --name lab
What it means: Creates kubeconfig context kind-lab.
Example 5: minikube start alternative
Type this:
printf '%s\n' 'minikube start --driver=docker'
You will see:
minikube start --driver=docker
What it means: Use minikube if your team standard says so.
Example 10: Docker must be running
Type this:
docker info >/dev/null 2>&1 && echo docker_ok || echo docker_needed
You will see:
What it means: kind and minikube docker driver need a working Docker engine.
Concept 2: Context safety
Every kubectl uses the current context.
Why: Wrong context applies YAML to prod.
What: get-contexts + current-context.
How: Name lab clusters clearly.
Example 6: kubectl get nodes
Type this:
printf '%s\n' 'kubectl get nodes'
You will see:
What it means: Ready under STATUS means the lab API works.
Example 7: Current context
Type this:
printf '%s\n' 'kubectl config current-context'
You will see:
kubectl config current-context
What it means: Wrong context is the classic prod accident — always check.
Example 8: List contexts
Type this:
printf '%s\n' 'kubectl config get-contexts'
You will see:
kubectl config get-contexts
What it means: Star marks the active context.
Concept 3: Prove and clean
get nodes Ready; delete when done.
Why: Forgotten clusters fill the disk.
What: get nodes; kind delete.
How: WSL2 on Windows; brew on Mac.
Example 9: Delete kind cluster
Type this:
printf '%s\n' 'kind delete cluster --name lab'
You will see:
kind delete cluster --name lab
What it means: Clean labs keep disk free on shared laptops.
Example 12: Mac note
Type this:
printf '%s\n' 'On Mac: brew install kubectl kind # or minikube'
You will see:
On Mac: brew install kubectl kind # or minikube
What it means: Apple Silicon needs arm64 binaries.
Example 1: Check if kubectl exists
Type this:
command -v kubectl >/dev/null && kubectl version --client 2>/dev/null | head -1 || printf '%s\n' 'kubectl not installed yet'
You will see:
What it means: Client-only version works even without a cluster.
Install card
1 kubectl 2 Docker running 3 kind or minikube start 4 current-context 5 get nodes
Suppose: kind fails
Start Docker first.
Suppose: wrong cluster
kubectl config get-contexts and switch.
Ravindra Bagale's Tip
At Cognizant labs, kind on Docker is the default interview prep cluster. Reviewers ask how you switch contexts safely.
Cognizant labs मध्ये Docker वर kind interview prep default. Reviewers context switch सुरक्षित कसे विचारतात.
Cognizant labs में Docker पर kind interview prep default है। Reviewers सुरक्षित context switch पूछते हैं।
Check yourself (quiz)
Q1. Client binary?
kubectl
Q2. kind needs?
Docker engine
Q3. Prove API?
kubectl get nodes Ready
Q4. Safety check?
current-context
Q5. Windows path?
WSL2 + Docker Desktop
Q6. Cleanup?
kind delete cluster
Reading tracking
Mark this guide when you finish. Your browser remembers it on this device.
install → start → context → get nodes.
Did you understand? Let us try it once more.
Frequently asked questions
kind or minikube?
Follow your team; both are valid labs.
Why Docker?
These drivers run nodes as containers.
No nodes Ready?
Wait or check docker ps / kind logs.
Multiple contexts?
get-contexts; switch explicitly.
Windows?
WSL2 + Docker Desktop.
Mac ARM?
Install arm64 builds.