Deployment
What is Deployment?
Deployment: The standard way to run stateless apps. It manages a ReplicaSet and gives you rolling updates, rollbacks, and a declared replica count. A Deployment is the standard Kubernetes object for running stateless applications, such as web servers and APIs. You declare which image to run and how many copies, and Kubernetes keeps that many pods running.
Frequently asked questions about Deployment
How is Deployment used in practice?
It also handles updates. When you change the image, the Deployment replaces pods gradually, keeping the application available. If the new version fails its health checks, the rollout stops, and kubectl rollout undo brings back the previous version.
What should you keep in mind with Deployment?
Good Deployments have readiness and liveness probes, resource requests and limits, and more than one replica for anything important. That way Kubernetes knows when a pod is ready for traffic, restarts it when it hangs, and places it sensibly. For databases and other stateful services, a StatefulSet or a managed database is usually the better choice.
What does an example of Deployment look like?
apiVersion: apps/v1 kind: Deployment metadata: name: web spec: replicas: 3 selector: matchLabels: { app: web } template: metadata: labels: { app: web } spec: containers: - name: web image: nginx:1.27 At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |