an excellent primitive for implementing distributed stateful applications generically. It addresses the need for persistent storage, networking (through Services), identity, ordinality, and a few other aspects. It provides a good set of building blocks for man‐ aging stateful applications in an automated fashion, making them first-class citizens in the cloud-native world. StatefulSets are a good start and a step forward, but the world of stateful applications is unique and complex. In addition to the stateful applications designed for a cloud- native world that can fit into a StatefulSet, a ton of legacy stateful applications exist that have not been designed for cloud-native platforms, and have even more needs. Luckily Kubernetes has an answer for that too. The Kubernetes community has real‐ ized that rather than modeling different workloads through Kubernetes resources and implementing their behavior through generic controllers, it should allow users to implement their custom  Controllers  and even go one step further and allow modeling application resources through custom resource definitions and behavior through Operators . In Chapter 22 and Chapter 23, you will learn about the related  Controller  and  Opera‐ tor  patterns, which are better suited for managing complex stateful applications in cloud-native environments. More information • Stateful Service Example • StatefulSet Basics • StatefulSets • Deploying Cassandra with Stateful Sets • Running ZooKeeper, a Distributed System Coordinator • Headless Services • Force Delete StatefulSet Pods • Graceful Scaledown of Stateful Apps in Kubernetes • Configuring and Deploying Stateful Applications More information  |  97