QUICK START:HTMLCSSJavaScriptTypeScriptPythonSQLReactNext.jsNode.jsDSASystem DesignDevOpsCybersecurityAI / ML
Advanced 22 min readModule: Module 7: Kubernetes Deployments, Services & Ingress

Deployments, Services & Ingress Controllers

Orchestrate zero-downtime rolling updates with Deployments and expose services to internet traffic via Ingress.

What You Will Learn in This Lesson

  • Deployments for managing replica sets and rolling zero-downtime updates
  • Kubernetes Services (ClusterIP, NodePort, LoadBalancer) for stable internal DNS
  • Ingress Controllers (NGINX/Traefik) for SSL termination and HTTP path routing

Introduction & Core Concept

Deployments maintain a specified number of Pod replicas, automatically replacing failed instances. Services provide stable virtual IPs and load balancing across dynamic pods.
WHY DOES THIS MATTER IN THE REAL WORLD?

During a new version release, Kubernetes Deployments spin up new pods and health-check them before terminating old pods, achieving 0 downtime.

Kubernetes Deployment & Service Manifest

yaml
yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
apiVersion: apps/v1
kind: Deployment
metadata:
name: kwas-web-deployment
spec:
replicas: 3
selector:
matchLabels:
app: kwas-web
template:
metadata:
labels:
app: kwas-web
spec:
containers:
- name: web
image: kwasacademy/web:2.0.0
ports:
- containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
name: kwas-web-service
spec:
type: ClusterIP
selector:
app: kwas-web
ports:
- port: 80
targetPort: 3000

Line-by-Line Technical Breakdown

1Readiness and Liveness probes prevent traffic from being sent to starting or unhealthy containers.

Try It Yourself (Interactive Editor)

Modify the code in real-time and click Run to test live browser output and console logs.

Intelligent Code Runner & Live Sandbox[YAML]
YAML SOURCE EDITOR
Interactive Live Code

Industry Best Practices & Professional Standards

  • Always configure livenessProbe and readinessProbe on container specs.

Lesson Summary & Core Takeaways

  • Deployments and Services provide self-healing, zero-downtime container management.