K8s Bootcamp Day 9 — State Persistence: PV, PVC, Storage Classes & Stateful Sets

Erandi Ganepola
9 min readMay 5, 2024

K8s Bootcamp: Forge Your Superpower with Hands-on Exercises from Novice to Advanced Deployments

Hello there!

Welcome to the 9th article of the K8s Bootcamp series. If you are new here, get a quick start to this article series with my first article on K8s Essentials: Pods, Deployments, and Your Superpower.

This K8s Bootcamp will discuss novice to advanced K8s concepts and hands-on exercises. Also, this article series will benefit you in achieving your CKAD certification.

Creative Commons License details

In this article, we will explore how to achieve state persistence in K8s. Given the transient nature of pods, which can be destroyed and recreated along with their memory, ensuring data persistence is crucial. We will discuss how this can be achieved using Persistent Volumes, Storage Classes, and Stateful Sets.

So let’s get started!

Volumes

Let's take Docker containers as an example. Those are designed to be transient, which means any data stored inside a container is lost when the container is terminated. To counter this, we attach volumes to the docker containers.

--

--

Erandi Ganepola

Solutions Architecture | Thinker | @WSO2 LLC for North America