icon picker
Kubernetes & Docker

🐳 Part 1: Docker – Containerization

Step 1: Understand the Basics

What is a container?
Difference between VM and container
Why Docker? Use-cases in dev and prod
📚 Learn:
YouTube:

Step 2: Install Docker

Install Docker Desktop (Windows/Mac) or Docker Engine (Linux)
🔗

Step 3: Learn Docker CLI

bash
CopyEdit
docker --version
docker run hello-world
docker ps -a
docker images
docker exec -it <container> /bin/bash

🧪 Try:
bash
CopyEdit
docker run -d -p 8080:80 nginx

Step 4: Docker Images

Dockerfile basics
docker build
docker tag, docker push
📄 Sample Dockerfile:
Dockerfile
CopyEdit
FROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]

🧪 Project: Dockerize a Node.js or Go app.

Step 5: Volumes & Networking

Bind Mount vs Volume
Docker networks (bridge, host, none)
Compose multi-container setup
📦 Practice:
yaml
CopyEdit
# docker-compose.yml
version: "3"
services:
web:
image: nginx
ports:
- "80:80"

Step 6: Debugging & Logs

docker logs <container>
docker inspect
docker stats
🛠️ Tools:
– GUI for Docker

☸️ Part 2: Kubernetes – Orchestration

Step 1: Learn Kubernetes Architecture

Master, Node, Pod, ReplicaSet, Deployment
Services: ClusterIP, NodePort, LoadBalancer
ConfigMap, Secret, Volumes

Step 2: Install K8s Locally

Best:
Alternative: Docker Desktop (Kubernetes enabled)
bash
CopyEdit
minikube start
kubectl get nodes

Step 3: Learn kubectl Commands

bash
CopyEdit
kubectl get pods
kubectl apply -f deployment.yaml
kubectl describe pod <pod-name>
kubectl logs <pod-name>

📘 Use:

Step 4: Write K8s YAML Files

deployment.yaml
yaml
CopyEdit
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 2
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myapp:latest
ports:
- containerPort: 3000

Step 5: Services and Networking

Expose pods using kubectl expose
Types: ClusterIP, NodePort, LoadBalancer
bash
CopyEdit
kubectl expose deployment myapp --type=NodePort --port=3000

Step 6: ConfigMaps, Secrets, Volumes

Store env vars in ConfigMap
Use Secret for sensitive data
Use PersistentVolumeClaim for storage

Step 7: Helm (Package Manager)

Install charts for Prometheus, NGINX, etc.
bash
CopyEdit
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-nginx bitnami/nginx

🔗

Step 8: Monitoring & Observability

Prometheus + Grafana
Lens (K8s GUI)
kubectl top, events

🔧 Mini-Projects for Practice

Dockerize a React + Node.js app and run using Docker Compose.
Deploy the app in Minikube with 3 replicas.
Expose the app via NodePort.
Add ConfigMap for dynamic config.
Deploy MongoDB with Persistent Volume and Secret.
Use Helm to install WordPress.

📚 Resources

Book: Kubernetes Up & Running
YouTube:

🎯 Final Goal

Be able to:
Build, tag, push Docker images
Use Docker Compose for dev environments
Deploy applications on Kubernetes with high availability
Handle configs/secrets/storage
Monitor and scale applications
Would you like a Notion page, PDF guide, or interactive roadmap app version of this as well?




Docs for learning


🐳 Docker: Start Here

1. Official Docker Documentation

📘 Beginner-friendly and very well maintained.
Includes:
Docker Desktop installation
Basic commands: docker build, docker run, docker ps, etc.
Container vs. Image explanation
Docker Compose basics

2. Docker Playground (No Install Required)

Run Docker in browser!
Great to practice without installing anything.

3. Docker Curriculum (By Prakhar Srivastav)

Excellent interactive tutorial using real-world examples.
Topics:
Creating and running containers
Dockerfiles and images
Networking and volumes
Docker Compose
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.