Skip to content

Storage Class

This page describes how to use and configure different storage classes to be used for backups.

A Kubernetes Storage Class is used for automatic hot storage disk provisioning in the tiered storage architecture of Kannika Armory.

It can be configured in two ways:

  • on application-level using the .storage.class option in the configuration of the operator,
  • on a per-volume basis using a Volume Storage.

The default storage class can be configured using operator.config.storage.class in the Helm chart.

values.yaml
operator:
config:
storage:
class: "my-storage-class"

This value will be written to the configuration file of the operator.

The Storage Class can be configured in the .spec.volume.storageClass field of a Volume Storage resource.

apiVersion: kannika.io/v1alpha
kind: Storage
metadata:
name: my-storage
spec:
volume:
capacity: 100Gi
storageClass: "my-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.

For minikube, the csi-hostpath-driver addon must be enabled.

Terminal window
$ minikube addons enable csi-hostpath-driver

See: CSI Driver and Volume Snapshots

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

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/v1
kind: StorageClass
metadata:
name: kannika-aws-ebs-csi
provisioner: kubernetes.io/aws-ebs
volumeBindingMode: Immediate
parameters:
type: gp2 # This configures SSDs (recommended).
allowVolumeExpansion: true
reclaimPolicy: Retain

Set the config.storage.class option to kannika-aws-ebs-csi to use this storage class in the Helm chart (see above).