Skip to content
Theory · Storage · lesson 5 of 7

StatefulSets in brief

Regular library readers have named lockers: locker 0 holds Anna's books, locker 1 holds Boris's. Anna comes on any day and sits at any desk, but takes her books from her own locker, not from the first free one. A database of several copies works the same way: each copy has its own name and its own data, and after a restart it must come back to exactly those. A Deployment cannot do that.

In this lesson

  • When a Deployment is not enough
  • A StatefulSet manifest
  • A Pod comes back to its data
  • A headless Service
  • Common mistake
  • Key points