categories.containers-platform Basic
What are the roles of Pod, Deployment, and Service in Kubernetes?
Pod
The smallest deployable unit in Kubernetes, containing one or more containers that share networking and storage.
- Containers in the same Pod share an IP address and localhost
- Pods are ephemeral — they don't auto-restart after crashing
- Avoid deploying Pods directly; use Deployments to manage them
Deployment
Manages the desired state of Pods, providing:
- Replica control: Maintains a specified number of Pod replicas
- Rolling updates: Gradually replaces old Pods to ensure zero-downtime updates
- Rollback: Quickly revert to a previous version
spec: replicas: 3 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 maxSurge: 1
Service
Provides a stable network endpoint so other services can discover and connect to Pods (since Pod IPs are dynamic).
| Type | Description |
|---|---|
| ClusterIP | Accessible only within the cluster (default) |
| NodePort | Exposes via node IP + port |
| LoadBalancer | Integrates with cloud load balancers |
| ExternalName | Maps Service to an external DNS name |
Relationship
Deployment → creates and manages Pods → Service uses Label Selectors to find Pods and route traffic
✦ AI Mock Interview
Type your answer and get instant AI feedback
Sign in to use AI scoring
