What are the best practices for stateful applications?
These types of questions are tricky. We recommend you keep in mind a few outcomes from this chapter:
- Different databases (relational and non-relational, key-value, in-memory, caches, etc.) can work in Kubernetes if you understand what you do 100%. However, it’s still recommended that more stable and durable methods, such as managed database services (e.g., Amazon Relational Database Service (RDS)), be used for critical databases. In general, Kubernetes today can work with stateful components and all other container workloads.
- Deploying stateful applications requires you to have a clear understanding and adoption of the following recommendations and processes:
- Use tested and trusted StorageClass configurations to control how PVs are provisioned. Choose the right reclaim policy (Retain, Delete, or Recycle), volume binding mode (Immediate or WaitForFirstConsumer), and storage backend (e.g., Solid...