Stupid Simple Kubernetes — Persistent Volumes explained by examples

Everything you need to know to set up production-ready Microservices with data persistency using Kubernetes

Czako Zoltan
10 min readJun 28, 2020

--

In the first article we already had a small introduction to Persistent Volumes and today we will dig into it more deeply, we will learn how to set up data persistency and we will write Kubernetes scripts to connect our Pods to a Persistent Volume. In this example, we will use Azure File Storage to store the data from our MongoDB database, but you can use any kind of volume to achieve to same results (like Azure Disk, GCE Persistent Disk, AWS Elastic Block Store, etc.)

If you want to follow along, it is a good idea to read my previous article before.

NOTE: the scripts provided are platform agnostic, so the tutorial can be followed using other types of cloud providers or using a local cluster with Minikube.

Requirements

Before starting this tutorial, please make sure that you have installed Docker. Kubectl will be installed with Docker. (if not, please install it from here).

The Kubectl commands used throughout this tutorial can be found in the Kubectl Cheat Sheet.

--

--

Czako Zoltan

I'm an experienced Full-Stack Developer, with experience in multiple domains including Backend, Frontend, DevOps, IoT, and Artificial Intelligence.