Increase DB Disk Space in Kubernetes
In this guide, we’ll walk through the steps required to increase the disk space available to a database running in a Kubernetes cluster. This can be necessary when your application needs to store more data, or when your current disk is reaching its capacity. We’ll cover the process using Persistent Volume Claims (PVCs) and StatefulSets, which are commonly used to deploy databases on Kubernetes.
Before we begin, ensure that you have:
- Administrative access to your Kubernetes cluster
- The
kubectl
command-line tool installed and configured - A backup of your database, to prevent data loss
Steps
- Downscale every StatefulSet
- Edit PersistentVolumeClaim of all disks, increasing the spec.resources.storage in reasonable amount
- Upscale back the StatefulSets