Storage Classes

Understanding Storage Classes in Thalassa Cloud Kubernetes

Thalassa Cloud provides Storage Classes in Kubernetes to define different types of persistent storage. A StorageClass allows users to dynamically provision Persistent Volumes (PVs) based on specific performance, durability, and cost requirements.

What is a Storage Class?

A StorageClass defines how persistent storage is provisioned in Kubernetes. It specifies the storage backend, parameters, and default behavior for dynamically provisioning Persistent Volumes (PVs). In Thalassa Cloud, storage classes provide optimized configurations for block storage and object storage solutions.

Default Storage Classes in Thalassa Cloud

Thalassa Cloud Kubernetes clusters come with predefined storage classes optimized for performance and reliability. The default storage class is:

  • block – High-performance NVMe-backed block storage for stateful applications.

To list available storage classes in your cluster, run:

kubectl get storageclass

Creating a Storage Class

Users can define custom storage classes to meet specific requirements. Below is an example of a custom storage class using Thalassa Cloud’s block storage:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: custom-storage-class
provisioner: csi.thalassa.cloud
parameters:
  type: block
reclaimPolicy: Retain
volumeBindingMode: Immediate

Apply the storage class:

kubectl apply -f storageclass.yaml

Explanation of Fields

  • provisioner – Defines the storage driver responsible for creating volumes (csi.thalassa.cloud).
  • parameters – Specifies backend configurations, such as block for NVMe-backed storage.
  • reclaimPolicy – Determines what happens when a Persistent Volume Claim (PVC) is deleted (Retain keeps the volume, Delete removes it).
  • volumeBindingMode – Controls when storage is provisioned (Immediate provisions instantly, WaitForFirstConsumer provisions when a pod requests it).

Using a Storage Class in Persistent Volume Claims

To request storage using a specific storage class, reference it in a Persistent Volume Claim (PVC):

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: custom-storage-class
  resources:
    requests:
      storage: 20Gi

Apply the PVC:

kubectl apply -f pvc.yaml

Checking PVC and Storage Class Usage

To verify which storage class a PVC is using:

kubectl get pvc my-pvc -o jsonpath='{.spec.storageClassName}'

Modifying an Existing Storage Class

Storage classes cannot be modified after creation. If you need different parameters, create a new storage class and update Persistent Volume Claims to use the new class.

Deleting a Storage Class

To remove an unused storage class:

kubectl delete storageclass custom-storage-class

Ensure that no active Persistent Volumes (PVs) depend on the storage class before deletion.

Summary

Storage Classes in Thalassa Cloud Kubernetes provide a way to dynamically allocate storage with optimized configurations for different workloads. Users can utilize the default block storage class or create custom configurations to meet specific performance and availability needs. Properly managing storage classes ensures scalable, efficient, and reliable persistent storage for applications.

Additional Resources