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
yamlyaml
12345678910111213141516171819202122232425262728293031apiVersion: apps/v1kind: Deploymentmetadata:name: kwas-web-deploymentspec:replicas: 3selector:matchLabels:app: kwas-webtemplate:metadata:labels:app: kwas-webspec:containers:- name: webimage: kwasacademy/web:2.0.0ports:- containerPort: 3000---apiVersion: v1kind: Servicemetadata:name: kwas-web-servicespec:type: ClusterIPselector:app: kwas-webports:- port: 80targetPort: 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 CodeIndustry 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.