LearnThatStack Ace your next interview
Kubernetes · question
Question 2 of 90

Explain the difference between Pods, Services, and Deployments.

beginner
← All Kubernetes questions
Re-explain

A Pod runs your containers, a Deployment keeps the right number of Pods running, and a Service gives those Pods one stable address.

  • A Pod is the smallest deployable unit. It holds one or more containers that share storage and network. Pods are ephemeral, so you rarely create them directly.
  • A Deployment is a higher-level object that manages ReplicaSets and rolls out changes to Pods declaratively. It keeps the desired number of replicas running.
  • A Service selects a set of Pods by label and gives them stable networking, one IP and DNS name that outlives any Pod. Other parts of the application call the Service, not Pod IPs.

The Deployment below keeps three nginx Pods running, and a Service with the selector app: nginx would send traffic to them.

# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.20
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the Kubernetes cheatsheet.

← Back to all Kubernetes questions
Pro · $10/mo

77 of 90 Kubernetes answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime