-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The Kubernetes Workshop
By :

In Figure 14.1, we can see that a StatefulSet is invoked to be able to manage pod life cycles. A StatefulSet (in older versions of Kubernetes, this was called a PetSet) operates very similarly to a Deployment in that we provide a pod template of what we want to run and how many instances of it we want to run. What differs between a StatefulSet and a Deployment is the following:
This means that in the preceding diagram when we name a StatefulSet mysql
, the first pod in that StatefulSet will always be mysql-0
. This is unlike a traditional deployment where pod IDs are assigned randomly. It also means that if you had a pod named mysql-2
and it crashed, it would be resurrected on the cluster using exactly the same name.
Depending on the update strategy in this StatefulSet, each pod will be taken down in a very specific order. So...