What are a Pod, a Deployment and a Service in Kubernetes? How do you expose a service outside the cluster?
Short answer
A Pod is the smallest schedulable unit: one or a few containers sharing an IP and volumes. A Deployment keeps N pods of the right version through a ReplicaSet and handles rolling updates. A Service is a stable name and IP load-balancing to pods matching a label, because pod IPs keep changing.
3 points to say:
- Pod: one or a few containers sharing a network namespace (
localhost) and volumes; when a pod dies its IP changes. - A Deployment manages ReplicaSets: replaces dead pods, does rolling updates and rollbacks.
- A Service only routes to ready pods matching its selector; outside the cluster use Ingress or Gateway API.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.