π 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
Subscribe to my newsletter
Read articles from Tathagat Gaikwad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
