Start a Conversation

Unsolved

R

1 Rookie

 • 

15 Posts

171

September 18th, 2023 21:03

What is Persistent Storage in Kubernetes? – DevOps Dialogs Lightboard Series

What is Persistent Storage in Kubernetes? – DevOps Dialogs Lightboard Series

Persistent Storage in Kubernetes is provided by both the Persistent Volume and Persistent Volume Claim objects in the Kubernetes API (Application Program Interface) resources.  Persistent volumes give applications a place to store data where the data remains protected beyond the lifecycles (failure, restart, reschedule...) of an individual container, pod, or node. Kubernetes has become the standard way to run cloud native applications in containers and originally, those applications were designed to run stateless. Applications on Kubernetes soon ran with stateful requirements and needed a way to provide a place to store application data in a safe and persistent location. 

Pods that run in Kubernetes do not use persistent volumes by default and any data written within a container's filesystem will be written to ephemeral storage where data will not persist beyond an event of a restart or failure. This is fine for stateless applications but not for stateful ones. Databases, for instance, need data to remain available across failure and lifecycle events because applications depend on the information stored within them for some time regardless of lifecycle events.  

Applications in Kubernetes can use several types of volumes, however, to persist data, they would need to use persistent volumes. There are various types of persistent volumes, one of the basic types is a host-path volume which mounts a directory on disk from the Kubernetes worker node to the pod/container. This enables data to remain intact beyond the container and pod lifecycle, but it does not allow data to be accessed on any other node nor does it protect against catastrophic node and drive failures.  

This is where the Container Storage Interface (CSI) comes into play for Kubernetes. CSI enables external plugins to allow persistent volumes to be provision dynamically or statically by external storage systems. These external storage systems allow data to be accessed wherever the pod is running on the cluster as well as enable data to persist beyond the container, pod, node and drive lifecycles and failures. External storage systems also enable advanced data capabilities such as deduplication, replication, copy management, backups and more. 

Check out this short high-level lightboard video helping to explain visually what persistent storage in Kubernetes is. 

Learn More: 

No Responses!

Top