🚀 Beginner’s Guide to Installing Kubernetes (K8s) – Step by Step
Series: 30 Days DevOps Interview Preparation
Author: Tathagat Gaikwad
Kubernetes has become the de facto standard for container orchestration. Whether you’re preparing for DevOps interviews or setting up your own production-ready environment, you’ll need to know how to install Kubernetes correctly.
In this blog, we’ll cover:
âś… What Kubernetes is (quick recap)
âś… Prerequisites for installation
âś… Kubernetes installation options (Minikube, Kind, AWS EKS)
âś… Step-by-step setup (local & AWS)
âś… Useful kubectl commands for beginners
🔹 What is Kubernetes?
Kubernetes (a.k.a. K8s) is an open-source platform designed to automate deploying, scaling, and managing containerized applications.
Think of Kubernetes as:
👉 Docker = Container runtime (how we package/run apps)
👉 Kubernetes = Container manager (how we schedule, scale, and heal apps across clusters).
🔹 Prerequisites for Kubernetes Installation
Before installing Kubernetes, make sure you have:
âś… System Requirements
OS: Linux (Ubuntu/Debian), macOS, or Windows 10+
CPU: Minimum 2 cores (4 recommended)
RAM: Minimum 4GB (8GB recommended for EKS)
Disk: 20GB free space
âś… Tools to Install
Docker – Container runtime
kubectl – Kubernetes command-line tool
Minikube / Kind – For local clusters
AWS CLI + eksctl – For AWS EKS setup
Helm (optional) – Kubernetes package manager
🔹 Kubernetes Installation Methods
There are 3 common ways to install Kubernetes:
Minikube → Best for beginners (local single-node cluster).
Kind (Kubernetes-in-Docker) → Lightweight local cluster.
AWS EKS (Elastic Kubernetes Service) → Cloud-managed Kubernetes (production-ready).
We’ll cover Minikube (local) and EKS (cloud).
🛠️ Installing Kubernetes with Minikube (Local Setup)
Step 1: Install Docker
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
Step 2: Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client
Step 3: Install Minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Step 4: Start Minikube Cluster
minikube start --driver=docker
Step 5: Verify Installation
kubectl get nodes
👉 Output should show 1 node ready. 🎉
🛠️ Installing Kubernetes on AWS EKS (Cloud Setup)
Step 1: Install Prerequisites
# AWS CLI
sudo apt-get install -y awscli
# eksctl
curl --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz
sudo mv eksctl /usr/local/bin
# kubectl
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/latest/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin
Step 2: Create an EKS Cluster
eksctl create cluster \
--name demo-cluster \
--region ap-south-1 \
--nodes 2 \
--node-type t3.medium \
--managed
Step 3: Verify Cluster
kubectl get nodes
kubectl cluster-info
Step 4: Deploy a Test App
kubectl create deployment hello-app --image=nginx
kubectl expose deployment hello-app --type=LoadBalancer --port=80
kubectl get svc hello-app
👉 Copy the external LoadBalancer URL → paste in browser → Your app is live on AWS EKS! 🎉
🔹 Useful kubectl Commands
# Get nodes and pods
kubectl get nodes
kubectl get pods
# Create a pod
kubectl run test-pod --image=nginx
# Scale deployment
kubectl scale deployment hello-app --replicas=3
# Rolling update
kubectl set image deployment/hello-app nginx=nginx:1.21
# Rollback
kubectl rollout undo deployment/hello-app
🎯 Interview Questions (with Answers)
Q1: Why do we need Minikube if we can use Docker directly?
👉 Docker runs containers on a single machine. Minikube simulates a Kubernetes cluster so you can practice orchestration.
Q2: What’s the difference between Minikube and AWS EKS?
👉 Minikube = local, single-node cluster for learning.
👉 EKS = cloud-managed, production-grade multi-node cluster.
Q3: Can we run Kubernetes without Docker?
👉 Yes. Kubernetes supports other runtimes like containerd and CRI-O.
Q4: What is the role of kubectl?
👉 kubectl is the CLI tool to interact with Kubernetes API server. You use it for creating pods, scaling, updating deployments, etc.
âś… Key Takeaways
Kubernetes requires Docker, kubectl, and a cluster setup (Minikube or EKS).
Minikube is best for beginners, EKS is best for real-world, cloud-native workloads.
Understanding Pods, Deployments, and Services is essential for DevOps interviews.
#Kubernetes #DevOps #AWS #EKS #Minikube #Cloud #InterviewPreparation




