Pods & DeploymentsBeginner
1Question 1 of 1
yamlWhat is the difference between a Pod and a Deployment in Kubernetes?
Explanation & Concept
• Pod: The smallest deployable computing unit in Kubernetes. A Pod encapsulates one or more containers that share storage, network IP address, and port space. • Deployment: A higher-level controller that manages Pod lifecycles declaratively. It handles automated rolling updates, rollbacks to previous revisions, self-healing (replacing crashed pods), and scaling.
Code Example
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-deployment
spec:
replicas: 3 # Maintains exactly 3 healthy Pod instances
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: nginx
image: nginx:1.25-alpine
ports:
- containerPort: 80How It Works & Key Takeaways
If a worker node crashes, the Deployment controller automatically schedules replacement Pods on surviving nodes to maintain the desired replica count of 3.
Mock Test · 1 Questions · Optional
Ready for Services & Ingress?
Take a quick test to evaluate yourself, or move straight to the next module.
Beginner1 questions