# Kubernetes Deployment

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

**Field:** Infrastructure  
**Category:** Container Orchestration  
**Also known as:** K8s Deployment, Deployment (Kubernetes), ReplicaSet

## 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.

## 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

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.

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Kubernetes Pod](https://learn.benibix.com/term/infrastructure/kubernetes-pod)
- [Kubernetes Service](https://learn.benibix.com/term/infrastructure/kubernetes-service)
- [Rolling Update](https://learn.benibix.com/term/development/rolling-update)
- [Rollback](https://learn.benibix.com/term/development/rollback)
- [Deployment (Software)](https://learn.benibix.com/term/development/deployment)
- [kubectl](https://learn.benibix.com/term/infrastructure/kubectl)

## Told apart from

- [Kubernetes Deployment vs Deployment (Software)](https://learn.benibix.com/compare/kubernetes-deployment-vs-deployment): People read a Kubernetes Deployment as the act of deploying, and it is not that. Deploying is the act of putting a new version live, by any means. A Kubernetes Deployment is a saved setting in a cluster. It keeps a set number of pods running and swaps them in when the image changes.

![Traffic from the internet enters on the left. An ingress reads the web address and sends shop.example.com to a service. The service spreads the requests across three identical pods. A dashed box around the three pods is marked deployment, which keeps three of them running.](https://learn.benibix.com/diagrams/inf-k8s-traffic.svg)

---

Source: https://learn.benibix.com/term/infrastructure/kubernetes-deployment
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
