Kubernetes Workload Management
medium

Pregunta de Kubernetes Workload Management #019e3a4f

Enunciado de la Pregunta
Kubernetes Workload Management
#kubernetes
#deployment
#stateless
#scalability
Medio

Which API object is the recommended way to run a scalable, stateless application on your cluster?

A

ReplicaSet

B

Deployment

Correcto
C

DaemonSet

D

Pod

Explicación Oficial / Explicaciones de la Comunidad

The Deployment API object is the recommended way to run a scalable, stateless application on a Kubernetes cluster. It provides declarative updates for Pods and ReplicaSets, enabling features like rolling updates, rollbacks, scaling, and self-healing.

How it Works

A Deployment manages a ReplicaSet, which in turn manages Pods. When you update a Deployment, it creates a new ReplicaSet and gradually scales it up while scaling down the old one, ensuring zero downtime. Deployments are ideal for stateless applications because they can be scaled horizontally by adjusting the replica count, and they automatically replace failed Pods.

Why the Correct Choice is Right

  • Deployment is the standard for stateless workloads because it supports rolling updates, rollbacks, and easy scaling. It abstracts away the underlying ReplicaSet management, making it the highest-level and most feature-rich option for stateless applications.

Why the Incorrect Choices are Wrong

  • ReplicaSet: While a ReplicaSet ensures a specified number of Pod replicas are running, it lacks the update and rollback capabilities of a Deployment. Direct use of ReplicaSet is not recommended; Deployments should be used instead.
  • DaemonSet: This ensures that all (or some) Nodes run a copy of a Pod. It is designed for system daemons like log collectors or monitoring agents, not for scalable stateless applications.
  • Pod: A Pod is the smallest deployable unit in Kubernetes. Running a single Pod directly does not provide scalability, self-healing, or updates. Pods are meant to be managed by higher-level controllers like Deployments.