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.


Reading Time: 2 minutes

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-by-Step Tutorial

  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
      name: database
    provisioner: csi.quobyte.com
    allowVolumeExpansion: true
      quobyteTenant: "My Tenant"
      ... (see https://github.com/quobyte/quobyte-csi/blob/master/example/StorageClass.yaml for the full StorageClass)
      labels: "encrypted:yes,profile:database"
  2. Create a Policy in Quobyte

    The next 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:

  3. Give the rule a name and a description.
    • Then add a policy restriction for "volume" and select "volume label matches regexp" in the scope.
    • Next, add "profile" and "database" like in our StorageClass.yaml. This tells Quobyte to apply the policies to all volumes with matching labels.
  4. The following 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.

Talk to Us

Quobyte can do a lot more for you than what you’ve seen so far.

To find out what, contact us to set up a quick demo.

Talk to us