Managing stateless and stateful data
When we think about storing an application’s data, we must consider whether the data should persist or whether it’s temporary. If the data must persist when a Pod is recreated, we must take into account that data should be available cluster-wide because containers may run on any worker host. Containers’ state isn’t stored by Kubernetes. If your application manages its state by using files, you may use volumes, but if this is not possible – for example, because multiple instances work at the same time – we should implement a mechanism such as a database to store its status and make it available to all instances.
Storage can be either filesystem-based, block-based, or object-based. This also applies to Kubernetes data volumes, hence before moving forward on how Kubernetes provides different solutions for volumes, let’s have a quick review of these storage-type concepts:
- Filesystem-based storage...