So far, we have seen how we can use Kubernetes to automatically provision EBS volumes for PersistentVolumeClaim. This can be very useful for a number of applications where we need a single volume to provide persistence to a single pod.
We run into problems though, as soon as we try to scale our deployment up. Pods running on the same node may end up sharing the volume. But as EBS volumes can only be attached to a single instance at any one time, any pods scheduled to another node will get stuck with the ContainerCreating status, waiting endlessly for the EBS volume to be attached.
If you are running an application where you want each replica to have its own unique volume, we can use a stateful set. Stateful sets have two key advantages over deployments when we want to deploy applications where each replica needs to have its own persistent storage.
Firstly, instead...