π©️ Lab Environment on Amazon Web Services using Amazon EC2
Ubuntu 22.04
t2.medium
SSH login
πΉ STEP 1 — Install Docker
✅ Why?
Minikube runs Kubernetes inside Docker containers
Check:
π works = good
πΉ STEP 2 — Install kubectl
✅ Why?
kubectl = control Kubernetes cluster
πΉ STEP 3 — Install Minikube
π€ Why Minikube is necessary?
Before Minikube:
❌ need 3–5 servers
❌ costly
❌ complex
With Minikube:
✅ single node cluster
✅ local testing
✅ fast learning
✅ safe experiments
π Think:
Install:
Start:
Check:
Observe:
π Cluster ready
π§ Now Kubernetes Objects (one by one)
π¦ POD
✅ What?
Smallest deployable unit
✅ Why?
Container cannot run alone → must be inside Pod
Think:
Commands
Observe
Create → Running
Delete → Gone permanently
❌ No self-healing
Learning
Pod = testing only
Not production
π REPLICASET
✅ What?
Keeps fixed number of Pods
✅ Why?
If server crashes → auto recreate
Commands
Delete one:
Observe:
π new pod auto-created
Learning
ReplicaSet = self-healing
π DEPLOYMENT
✅ What?
Manages ReplicaSets
✅ Why?
Because we need:
✅ rolling update
✅ rollback
✅ scaling
ReplicaSet cannot update safely
Commands
Observe:
pods 1 → 5
Update:
Rollback:
Learning
Deployment = production controller
π METRICS SERVER
✅ What?
Collects:
CPU
Memory
✅ Why?
Required for:
kubectl top
HPA
Without metrics → no autoscaling
Install
Check:
Observe:
CPU/memory values
⚡ HPA (Horizontal Pod Autoscaler)
✅ What?
Auto increase/decrease pods
✅ Why?
Traffic changes daily
Without HPA:
❌ waste money
❌ app crashes
With HPA:
✅ scale automatically
✅ cost efficient
π₯ How to do HPA (step-by-step)
Step 1 — Create deployment first
Step 2 — Attach autoscaler
Step 3 — Monitor continuously
Open 3 terminals:
T1
T2
T3 generate load
Inside:
Observe
Pods:
Stop load:
Commands to repeatedly check
Learning
Metrics → HPA → Deployment → Pods scale
π₯️ DAEMONSET
✅ What?
Runs 1 pod on every node
✅ Why?
Some apps must run everywhere
Examples:
logging
monitoring
security agents
Commands
Observe:
1 pod per node
Learning
DaemonSet = node-level service
π¨ kubecolor
Why?
Better readability
Install:
Now outputs colorful
π§ FINAL BIG PICTURE (memory trick)
You’ve basically covered 80% of real Kubernetes used in companies already ππ₯
Comments
Post a Comment