Data Persistence in Kubernetes | Kubernetes Volumes simply explained
TechWorld with Nana
Posted on May 16, 2020
The problem
Kubernetes doesn't provide data persistence out of the box, which means when a pod is re-created, the data (of a database application for example) is lost. 🙉
So, you need to create and configure the actual physical storage and manage it by yourself.
How to do it 👩🏻💻
Once configured, you can use that physical storage using Kubernetes storage components.
In this video I show you 3 different Kubernetes volume components, that you need to use to connect the actual physical storage to your pod, so that the application inside the container can access it.
3 Volume Components
- The 1st component "Persistent Volume" is a cluster resource, like CPU or RAM, which is created and provisioned by administrators.
- The 2nd component "Persistent Volume Claim" on the other hand is a user's or pod's request for a persistent volume.
- With the 3rd component "Storage Class" you can dynamically provision Persistent Volume component and so automate the storage provisioning process.
ConfigMap and Secret as Volume Types
ConfigMap and Secret components can be used to:
- create individual key-value pairs, like db credentials or db url
- but also create configuration files, that can be mounted into the pod as volumes
You can find the full video here:
Kubernetes 101 ► Compact and easy-to-read ebook bundle 🚀
It's a handy way to quickly look something up or refresh your knowledge at work and use it as your cheatsheet 😎
I'm happy to connect with you on 🙂
Posted on May 16, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.