Skip to content
BENIBIX Learn

Kubernetes Deployment

Infrastructure☸️ Container OrchestrationKubernetes

Also known as K8s Deployment, Deployment (Kubernetes), ReplicaSet

A Kubernetes setting that keeps a set number of pods up. It swaps them in safely.

Think of it like

It is like a coach who keeps eleven players on the field. If one gets hurt, a new one runs on.

Example

Lucy's deployment asks for 3 copies of the shop app. She changes the image to version 2.4, and the pods are swapped one by one with no downtime.

Why it matters

It is how most apps run in Kubernetes. You get self-healing and safe updates with no extra code.

Definition

A Kubernetes deployment keeps a set number of matching pods running. You say which image to use and how many copies you want. If a pod dies, the deployment makes a new one. When you change the image, it swaps old pods for new ones a few at a time. If the new version goes wrong, you can roll back to the last one.

Example code

console
$ kubectl get deployments
NAME               READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deployment   3/3     3            3           18s
Three of three copies are ready. If one dies, the deployment brings the count back to three.
The deployment is the dashed box. It keeps three matching pods alive behind the service.

Common mistake

Running a database as a deployment. Its pods are swapped freely, so data that must stay put needs a different object.

Key takeaways

  1. 1
    A set count. It keeps the number of copies you asked for.
  2. 2
    Rolling updates. New pods replace old ones a few at a time.
  3. 3
    Easy rollback. A bad version can be undone in one step.

Compare