SteelReed

Search

Search posts, questions…

DevOps & CloudQuestion 19 / 35

Junior

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.

label selectorlabel selectorIngress / Gateway APIService: ClusterIP + DNSPod v2Pod v2DeploymentReplicaSet: keeps N pods

3 points to say:

  1. Pod: one or a few containers sharing a network namespace (localhost) and volumes; when a pod dies its IP changes.
  2. A Deployment manages ReplicaSets: replaces dead pods, does rolling updates and rollbacks.
  3. 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.