Connect Kubernetes StorageClasses with Quobyte's Policy Engine

Our tutorial shows you an easy way to serve multiple persistent volume types from the same Kubernetes cluster like all-flash, archival or encrypted persistent volumes.

Once you have the Quobyte CSI Plugin and Quobyte client running on your Kubernetes cluster you are ready to dynamically provision persistent volume claims form Quobyte. Quobyte's Policy Engine gives you control over many aspects of your data, such as the redundancy mechanism (replication, EC or auto), storage media (flash, HDD or a combination of both), tiering, encryption, caching or QoS.

Step 1 - Create a Storage Class in Kubernetes

The first step is to "connect" your Kubernetes Storage Classes with the Quobyte policy engine. The easiest way is to add labels. These labels are simple key-value pairs that are attached to the Quobyte volume when it is created by the CSI plugin. You can add labels to your storage class in the Parameters section. The labels are a comma separated list of key:value pairs:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: database
provisioner: csi.quobyte.com
allowVolumeExpansion: true
parameters:
  quobyteTenant: "My Tenant"
  ... (see https://github.com/quobyte/quobyte-csi/blob/master/example/StorageClass.yaml for the full StorageClass)
  labels: "encrypted:yes,profile:database"
                  

Step 2 - Create a Policy in Quobyte

The second step is to create policies in Quobyte to map your storage class labels to behavior you want on Quobyte. Let's create our Policy for the database as an example:

Go to the Policy tab in the Quobyte webconsole and select "Create rule with custom policy..."from the dropdown:

Give the rule a name and a description. Then add a policy restriction for "volume" and select "volume label matches regexp" in the scope. Then add "profile" and "database" like in our StorageClass.yaml. This tells Quobyte to apply the policies to all volumes with matching labels.

The next step is to configure policies on how to handle the data on such a volume. Databases do a lot of random 4k IO, which is best suited for replication and flash media. Under the "File Placement Policies" subsection add the Tag based placement and select ssd:

This tells Quobyte to always put files on these volumes onto ssds. Then we add "File Redundancy" in the "File Creation Policies" tab and set it to REPLICATION.

Any volume with the Database storage class will now map onto a high performance random IO profile on Quobyte. You can change the policies at any time and most options will be applied immediately (such as cache settings), during a time you specified (data tiering and movement) or apply only to new files (such as redundancy mechanism).

These features are available in all our editions, including the Quobyte Free Edition. If you haven't installed Quobyte on your kubernetes cluster yet, check out our tutorial here.

Learn more about Kubernetes with Quobyte

Tutorial logo

How to set up shared file system (RWX) persistent volumes on Kubernetes with Quobyte

READ MORE

Tutorial logo

How to combine flash and HDD in Quobyte for fast and cost-effective Persistent Volumes

READ MORE

Tutorial logo

Consolidate your Kubernetes Storage with Quobyte's Multi-tenancy and Self-service.

READ MORE

Glossary logo

Confused by PV, PCV, CSI? Read our gloassary on K8s storage terms.

READ MORE