DEV Community

INUH LEE
INUH LEE

Posted on

DevOps Interview Practice #2: What’s the difference between a Deployment and a StatefulSet in Kubernetes?

I'm a Korean DevOps engineer preparing for international opportunities. Since English isn’t my first language, I’ve been practicing both my language skills and technical knowledge at the same time.

As part of my daily English practice, I asked ChatGPT (acting as my senior DevOps engineer) to give me one interview-style question each day. I try to answer in English based on what I know, and then improve my explanation through feedback and correction.

Here’s today’s question and my answer:


Question

What’s the difference between a Deployment and a StatefulSet in Kubernetes?


My First Answer (Raw)

Deployment is a controller which manages pods that don't need to be distinguishable because they are stateless. On the other hand, Statefulset is a controller which manages pods that need to be distinguishable becauae theu are stateful. sharded database is well known example for statefulset. each pod has to mount different volume so they must be distinguished.


Refined Answer (with feedback)

A Deployment is a controller that manages pods which don’t need to be distinguishable because they are stateless.
On the other hand, a StatefulSet is used for managing pods that must be distinguishable, since they are stateful.
A sharded database is a well-known example of a workload suited for StatefulSets, as each pod needs to mount a different volume and maintain a unique identity.

Top comments (0)