Storage Class
This page describes how to use and configure different storage classes to be used for backups and restores.
A Kubernetes Storage Class is used for automatic hot storage disk provisioning in the tiered storage architecture of Kannika Armory.
If no storage class is configured,
the operator will use the default storage class of the Kubernetes cluster (if available).
Configuring the storage class using Helm
Section titled “Configuring the storage class using Helm”The default storage class can be configured using operator.config.storage.class in the Helm chart.
operator: config: storage: class: "my-storage-class"This storage class will be used for all volumes created by the operator that do not have a specific storage class configured.
This includes:
- Volumes created when using a Volume Storage.
- Volumes created by Restores for Restore Reports.
Volume Storage Configuration
Section titled “Volume Storage Configuration”The Storage Class can be configured in the .spec.volume.storageClass field of a Volume Storage resource.
This takes precedence over the default storage class configured in the operator.
apiVersion: kannika.io/v1alphakind: Storagemetadata: name: my-storagespec: volume: capacity: 100Gi storageClass: "my-storage-class"Automatic detection of the storage class
Section titled “Automatic detection of the storage class”The operator attempts to detect which environment it is running in. Based on which environment, it will also attempt to detect which storage class needs to be installed, or needs to be used. Currently, minikube and Google Kubernetes Engine (GKE) are supported.
Minikube
Section titled “Minikube”For minikube,
the csi-hostpath-driver addon must be enabled.
$ minikube addons enable csi-hostpath-driverSee: CSI Driver and Volume Snapshots
Google Cloud Disks (GCE)
Section titled “Google Cloud Disks (GCE)”For GKE,
the GcePersistentDiskCsiDriver must be enabled.
Note that this is enabled by default on new clusters.
The operator will attempt to install a CSI-enabled storage class named kannika-gke-pd-csi,
if it has not done so yet.
See: Using the Compute Engine persistent disk CSI Driver
Amazon Elastic Block Store (EBS)
Section titled “Amazon Elastic Block Store (EBS)”No detection is done for AWS EBS yet.
However, you can use the ebs.csi.aws.com driver by installing it manually.
Here is an example of a StorageClass that can be used that is compatible with the operator and which retains volumes after deletion:
apiVersion: storage.k8s.io/v1kind: StorageClassmetadata: name: kannika-aws-ebs-csiprovisioner: kubernetes.io/aws-ebsvolumeBindingMode: Immediateparameters: type: gp2 # This configures SSDs (recommended).allowVolumeExpansion: truereclaimPolicy: RetainSet the config.storage.class option to kannika-aws-ebs-csi to use this storage class in the Helm chart (see above).