What is Kubernetes StateFulSet?

10/14/2019

I try to understand what is a Statefulset but I can not understand this. I know just it is like a ReplicaSet and copies from the Container will created. I have understood even it is appropriate for databases but the rest i could not understand. Can anybody explain that, maybe with a example or a use case ? Thanks for your helps.

-- Cosss
containers
docker
kubernetes
orchestration

2 Answers

10/14/2019

As name says statefulsets : In kubernetes if you are running the stateful application that time instead of deployment you have to use the statefulsets.

Stateful sets are used for application storing data in memory, session and handling state.

For example stateful set can be useful for Elasticsearch, Redis

-- Harsh Manvar
Source: StackOverflow

10/14/2019

Yes, it is similar to a replicaset but with some extra features like ensuring that only one pod is created at time and allowing a templated volume config so each pod gets different volumes (unlike a RS where the pod template results in every pod being identical). These features are aimed specifically at stateful applications like databases, though the specifics would depend on the database and are out of scope for an SO question.

-- coderanger
Source: StackOverflow