Kubernetes Tutorial — Part 2: Setting Up Your Local Environment

By Suraj Ahir March 05, 2026 8 min read

← Part 1 Kubernetes Tutorial · Part 2 of 12 Part 3 →
Kubernetes - Setting Up Your Local Environment
Kubernetes - Setting Up Your Local Environment

Before you can learn Kubernetes properly, you need a local environment where you can break things without consequences. Minikube gives you a single-node Kubernetes cluster on your laptop. It is perfect for learning because it behaves like a real cluster.

Installing the Tools

Install kubectl and Minikube
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl && sudo mv kubectl /usr/local/bin/

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube-linux-amd64 && sudo mv minikube-linux-amd64 /usr/local/bin/minikube

minikube start

Running Your First Pod

Create and Inspect a Pod
kubectl run my-nginx --image=nginx --port=80
kubectl get pods
kubectl describe pod my-nginx
kubectl logs my-nginx
kubectl port-forward pod/my-nginx 8080:80

Open http://localhost:8080 in your browser. You should see the nginx welcome page. That is your first application running on Kubernetes. Clean up with kubectl delete pod my-nginx.

In Part 3, we will learn about Deployments — the proper way to run applications with automatic scaling and self-healing.

← Part 1 Kubernetes Tutorial · Part 2 of 12 Part 3 →
← Back to Blog
Disclaimer: This content is for educational purposes only. SRJahir Tech does not guarantee any specific outcome, job placement, or exam result. Learning requires consistent effort and practical application.