Chapter 8. Stateful applications
This chapter covers
- Enabling a headless service
- Clustering applications
- Configuring sticky sessions
- Handling graceful shutdowns
- Working with stateful sets
In chapter 7, you created persistent storage for the Image Uploader pods, which allowed data to persist past the lifecycle of a single pod. When a pod failed, a new pod spun up in its place and mounted the existing persistent volume locally. Persistent storage in OpenShift allows many stateful applications to run in containers. Many other stateful applications still have requirements that are unsatisfied by persistent storage alone: for instance, many workloads distribute data through replication, which requires application-level clustering. In OpenShift, this type of data replication requires direct pod-to-pod networking without going through the service layer. It is also very common for stateful applications such as databases to have their own custom load balancing and discovery algorithms which require direct pod-to-pod access. Other common requirements for stateful applications include the ability to support sticky sessions as well as implement a predictable graceful shutdown.