However, we're not finished yet! Right now, if all of our Elasticsearch containers fail, the data stored inside them would be lost.
This is because containers are ephemeral, meaning that any file changes inside the container, be it addition or deletion, only persist for as long as the container persists; once the container is gone, the changes are gone.
This is fine for stateless applications, but our Elasticsearch service's primary purpose is to hold state. Therefore, similar to how we persist data using Volumes in Docker, we need to do the same with Kubernetes.
Like Docker, Kubernetes has an API Object that's also called Volume, but there are several differences between the two.
With both Docker and Kubernetes, the storage solution that backs a Volume can be a directory on the host machine, or it can be a part of a cloud solution like AWS.
And for both Docker and Kubernetes, a Volume is an abstraction for a piece of storage that can be attached...