ReplicaSet, Deployment, and StatefulSet Controllers

Describes Kubernetes ReplicaSets, Deployments, and StatefulSet Controllers.

Kubernetes provides various controllers that define how pods are set up and deployed within the Kubernetes cluster. These controllers can be used to group pods together according to their runtime needs, control the order in which the pods start up, and configure pod replication.

Define a set of pods to be replicated with a ReplicaSet, which provides the configuration for each of the pods in the group and which resources they have access to. Using ReplicaSets makes it easy to scale or reschedule an application and perform rolling or multi track updates to an application. For more information on ReplicaSets, see the upstream Kubernetes documentation.

Use a Deployment to manage pods and ReplicaSets. Deployments make it easy to roll out changes to ReplicaSets, or rollback to an earlier Deployment revision. Create a newer revision of a ReplicaSet with a Deployment and then migrate existing pods from a previous ReplicaSet into the new revision. The Deployment can then manage the cleanup of older unused ReplicaSets. For more information on Deployments, see the upstream Kubernetes documentation.

Use StatefulSets to create pods that guarantee start up order and unique identifiers, which are then used to ensure that the pod maintains its identity across the life cycle of the StatefulSet. This feature makes it possible to run stateful applications within Kubernetes, as the persistence of components such as storage and networking are guaranteed. Furthermore, when you create pods they're always created in the same order and allocated identifiers that are applied to host names and the internal cluster DNS. Those identifiers ensure stable and predictable network identities for pods in the environment. For more information on StatefulSets, see the upstream Kubernetes documentation.