MariaDB is a popular open-source relational database. Running it on Kubernetes gets you portability across environments, CI/CD integration, and automated backup/recovery alongside the usual scalability and high-availability benefits. This guide sets up persistent storage, deploys MariaDB as a StatefulSet, exposes it via a Service, and covers scaling.

Prerequisites: a Kubernetes cluster with at least 3 nodes and kubectl configured against it.

Create Persistent Volume and Claim

1. Define a PersistentVolume:

$ nano mariadb-pv.yaml