1. What We Built Already
Students already created:
Frontend Container
↓
Backend Container
↓
RDS PostgreSQL
Infrastructure:
Users
↓
ALB
↓
ECS Fargate
↓
Frontend Container
↓
Backend Container
↓
RDS PostgreSQL
Technologies:
- Docker
- ECS Fargate
- ECR
- RDS
- AWS Networking
- Security Groups
This is called:
Three-Tier Architecture
2. Problem with Traditional Backend
Initially companies create:
One frontend
One huge backend
One database
But when traffic grows:
Problems appear:
- Backend becomes huge
- One bug crashes entire backend
- Difficult deployments
- Scaling becomes expensive
- One team changes code → affects everyone
- Downtime during deployments
Example:
Netflix cannot keep:
1 giant backend
Instead they split services.
3. What Are Microservices?
Instead of:
backend-service
We split into:
auth-service
payment-service
course-service
student-service
notification-service
Each service:
- independent
- deploys separately
- scales separately
- owned by different teams
This is:
Microservice Architecture
4. What is Kubernetes?
Kubernetes (K8s)
Kubernetes is:
Container Orchestration Platform
It manages:
- containers
- scaling
- networking
- deployments
- recovery
- updates
Automatically.
Created by:
Based on:
Borg system
Now maintained by:
CNCF
5. Why Companies Use Kubernetes
Companies need:
- high availability
- scaling
- self healing
- automation
- rolling updates
- multi-cloud portability
Kubernetes solves these problems.
Used by:
- Netflix
- Uber
- Spotify
- Airbnb
- Amazon
- Banks
- Healthcare companies
6. ECS vs Kubernetes
| ECS | Kubernetes |
|---|---|
| AWS only | Multi-cloud |
| Easier | More complex |
| Faster to start | Industry standard |
| Less control | Very flexible |
| AWS manages much | You manage more |
| Simple learning curve | Steeper learning curve |
7. ECS Flow
In ECS we did:
Docker Build
↓
Push to ECR
↓
Task Definition
↓
ECS Service
↓
Running Containers
AWS handled:
- orchestration
- scheduling
- networking
8. Kubernetes Flow
In Kubernetes:
Docker Build
↓
Push to ECR
↓
Deployment YAML
↓
Pods
↓
Services
↓
Ingress
Kubernetes uses YAML configuration.
9. Kubernetes Architecture
Main components:
Control Plane
↓
Worker Nodes
↓
Pods
10. Control Plane
Control Plane = brain of Kubernetes
Components:
- API Server
- Scheduler
- Controller Manager
- etcd
Responsibilities:
- manage cluster
- schedule pods
- maintain desired state
11. Worker Nodes
Worker Nodes run applications.
Inside nodes:
- kubelet
- container runtime
- kube-proxy
Worker nodes host:
Pods
12. What is a Pod?
Pod = smallest Kubernetes object.
A Pod contains:
- one or more containers
Example:
Pod
├── frontend container
└── helper container
Usually:
- 1 container per pod
13. Why Pods?
Pods provide:
- shared networking
- shared storage
- lifecycle management
Containers inside pod communicate using:
localhost
14. Deployment
Deployment manages pods.
Example:
Deployment
↓
ReplicaSet
↓
Pods
Responsibilities:
- scaling
- rolling updates
- self healing
- restarting failed pods
15. ReplicaSet
ReplicaSet ensures:
desired pods = running pods
Example:
3 replicas requested
1 pod crashes
Kubernetes creates new pod automatically
16. Kubernetes Self-Healing
If pod crashes:
Kubernetes:
- detects failure
- recreates pod
- restores application
Automatically.
This is:
Self-Healing Infrastructure
17. Kubernetes Services
Pods change IPs constantly.
Service gives:
- stable endpoint
- internal communication
Types:
- ClusterIP
- NodePort
- LoadBalancer
18. ClusterIP
Default service.
Internal communication only.
Example:
frontend → backend-service
Inside cluster only.
19. NodePort
Exposes service on node port.
Example:
NodeIP:30080
Mostly for labs/testing.
20. LoadBalancer
Creates cloud load balancer.
In AWS:
- creates ALB/NLB automatically
Used for production.
21. Ingress
Ingress controls:
- HTTP routing
- domains
- SSL
- path routing
Example:
/api → backend
/admin → admin-service
Ingress acts like:
Smart Traffic Router
22. Kubernetes Networking
Each Pod gets:
- its own IP
Pods communicate directly.
Kubernetes provides:
- internal DNS
- service discovery
Example:
backend-service.default.svc.cluster.local
23. Kubernetes Storage
Containers are temporary.
Databases need persistence.
Kubernetes uses:
- Persistent Volumes
- Persistent Volume Claims
BUT:
Production companies usually keep databases outside cluster:
RDS
Aurora
Cloud SQL
24. Why RDS Outside Kubernetes?
Reasons:
- easier backups
- managed failover
- better stability
- managed scaling
- less operational risk
Very common architecture:
EKS + RDS
25. Kubernetes Scaling
Kubernetes can scale automatically.
Using:
HPA
Horizontal Pod Autoscaler.
Example:
CPU > 70%
Pods scale from 2 → 10
26. Rolling Updates
Without downtime.
Old pods terminate gradually.
New pods start gradually.
Users never notice deployment.
This is:
Zero Downtime Deployment
27. Production Kubernetes Architecture
Production flow:
Users
↓
CloudFront
↓
ALB
↓
Ingress
↓
Frontend Pods
↓
Backend Microservices
↓
RDS PostgreSQL
Monitoring:
Prometheus
Grafana
Loki
CloudWatch
CI/CD:
GitHub Actions
Jenkins
ArgoCD
28. Kubernetes Security
Production security:
- RBAC
- IAM Roles
- Secrets
- Network Policies
- Private Subnets
- TLS/SSL
Never store passwords in code.
Use:
- Kubernetes Secrets
- AWS Secrets Manager
29. Kubernetes YAML
Kubernetes uses YAML files.
Example structure:
apiVersion:
kind:
metadata:
spec:
Main files:
- deployment.yaml
- service.yaml
- ingress.yaml
30. Example Deployment YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 2
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: nginx
ports:
- containerPort: 80
31. Important kubectl Commands
Create resources:
kubectl apply -f deployment.yaml
View pods:
kubectl get pods
View services:
kubectl get svc
Describe pod:
kubectl describe pod pod-name
View logs:
kubectl logs pod-name
32. EKS (Elastic Kubernetes Service)
AWS Managed Kubernetes.
AWS manages:
- Control Plane
- High availability
- etcd
We manage:
- worker nodes
- deployments
- pods
33. Why Companies Love EKS
Benefits:
- Kubernetes without managing masters
- AWS integration
- IAM integration
- ALB integration
- CloudWatch integration
Very common in enterprise.
34. ECS vs EKS in Production
ECS:
- simpler
- faster
- easier for AWS-only environments
EKS:
- portable
- more powerful
- more enterprise demand
- industry standard
35. Real Production Example
E-commerce company:
Microservices:
- auth-service
- order-service
- payment-service
- inventory-service
- notification-service
Each service:
- independent deployment
- independent scaling
Traffic spike:
- only payment-service scales
Huge advantage.
36. Monitoring Kubernetes
Observability stack:
Prometheus → metrics
Grafana → dashboards
Loki → logs
Alertmanager → alerts
Your current stack already matches production patterns.
37. CI/CD Pipeline
Modern deployment flow:
Developer
↓
GitHub
↓
GitHub Actions
↓
Docker Build
↓
Push to ECR
↓
Deploy to EKS
38. Interview Questions
Common DevOps interview questions:
- What is Pod?
- Difference between ECS and EKS?
- What is Deployment?
- What is Service?
- What is Ingress?
- What is HPA?
- What happens when pod crashes?
- Difference between container and pod?
39. Career Impact
Kubernetes skills are highly demanded.
Roles:
- DevOps Engineer
- SRE
- Platform Engineer
- Cloud Engineer
- Kubernetes Administrator
40. Final Architecture Summary
Current:
3-Tier ECS Architecture
Future:
Production Kubernetes Microservices Platform
Final production vision:
Users
↓
CloudFront
↓
ALB
↓
Ingress
↓
Frontend Pods
↓
Microservices
↓
RDS
↓
Monitoring Stack
This is real enterprise architecture used in production today.
Top comments (0)