Kubernetes Deployments

Learn why Deployments are the standard way to run stateless applications and how they manage ReplicaSets and pods.

What Is a Deployment?

A Deployment is a higher-level Kubernetes resource for managing stateless applications. It keeps the desired number of pod replicas running and supports rolling updates and rollbacks.

Why Not Run Pods Directly?

A bare pod is fragile. If it dies, nothing automatically recreates it unless a controller manages it.

A Deployment gives you:

  • self-healing through managed replicas
  • easy scaling
  • rolling updates
  • rollback support

Deployment, ReplicaSet, and Pods

Deployment → ReplicaSet → Pods

Deployment

my-app

replicas: 3 · strategy: RollingUpdate

manages

ReplicaSet

my-app-7d9f4

desired: 3 · ready: 3

owns

Pod

Pod 1

Pod

Pod 2

Pod

Pod 3

ReplicaSet Relationship

A Deployment usually manages one active ReplicaSet and may keep older ReplicaSets around for rollout history and rollback.

Sub-pages in This Section

Sub-topicWhat you will learn
Create DeploymentsWrite YAML, apply it, scale it, and inspect ReplicaSets
Rolling UpdatesUnderstand rollout strategy and image updates
RollbacksRevert changes safely and inspect rollout history

When Deployments Fit Best

Deployments are ideal for:

  • web APIs
  • frontend services
  • stateless background workers

For stateful systems like databases, Kubernetes often uses other controllers such as StatefulSets.

Think of a Deployment as the manager that keeps the right number of identical workers on shift and replaces them when one leaves.

Exercise

Deployment Benefit

Why are Deployments usually preferred over creating bare pods directly?

Exercise

Immediate Child Resource

What resource does a Deployment directly manage?

Continue Learning

Explore Related Topics

Try the Tool

Related Resources