1

So, a StatefulSet creates a new volume for each of its pod.

How does it maintain consistency of the written data. Because, each pod may serve a different client at a specific moment in time and will be writing different stuff to the volume. But, if this client tries to access the data later, it will have to connect to the same pod somehow to access its own data. Do these pods talk to each other to share data?

I may have asked a silly question

Aniket
  • 13
  • 3

1 Answers1

2

There is no consistency of storage between pods, because there is no replication/syncing/copying of data to begin with. This part is the responsibility of the process within a pod.

StatefulSets are intended to run pods of a distributed database or of a distributed key-value store or other clustered software that somehow replicates storage volumes. For example, Kubernetes has a tutorial for running Cassandra as a StatefulSet. If a client comes and feeds one Cassandra Pod some data, it is this pod's responsibility to talk to other Cassandra pods and make sure the data is replicated in a consistent manner (it's never trivial).

kubanczyk
  • 13,502
  • 5
  • 40
  • 55