As part of our first major release of 2020, the Trident team has introduced a host of new features. This includes Virtual Storage Pools support for ONTAP backends, enhancing Trident’s ability to define StorageClasses to be backend-agnostic and employ key-value pairs to better group PVCs. With 20.01, you can define Virtual Storage Pools for all ONTAP drivers offered with Trident. 

Previous users of Trident will be familiar with how Virtual Storage Pools work; here’s a quick introduction on how you can define Virtual Storage Pools within your backend definition and then create StorageClasses that map to one or more storage pools.

What are Virtual Storage Pools and Why do I need them? 

As the documentation notes, Virtual Storage Pools provide a layer of abstraction between Trident’s storage backends and Kubernetes StorageClasses. They allow an administrator to define aspects like location, performance, and protection in a common way without making a StorageClass specify which specific backend to use. Think of these as json blocks that you define in your backend.json file, with a host of key:value pairs that help define multiple storage pools to provide a differential class of service.

Here’s an example:


    "version": 1, 
    "storageDriverName": "ontap-nas-economy", 
    "managementLIF": "10.0.0.1", 
    "dataLIF": "10.0.0.2", 
    "svm": "svm_nfs", 
    "username": "vsadmin", 
    "password": "secret",
    "defaults": { 
          "spaceReserve": "none", 
          "encryption": "false" 
    }, 
    "region": "us-east-1", 
    "storage": [ 
        { 
            "labels":{"department":"legal}, 
            "zone":"us-east-1b", 
            "defaults": { 
                "spaceReserve": "none", 
                “snapshotPolicy”: “daily”, 
                "encryption": "true", 
                "unixPermissions": "0755" 
            } 
        }, 
        { 
            "labels":{"department":"engineering"}, 
            "zone":"us-east-1c", 
            "defaults": { 
                "spaceReserve": "none", 
                "encryption": "true", 
                "unixPermissions": "0775" 
            } 
        } 
    ] 

This backend definition includes 2 Virtual Storage Pools [defined under the storage block]: 

  1. A “legal” storage pool, with its dedicated zone and customized defaults. There’s a daily snapshot policy that will be used and all PVs are encrypted. 
  2. An “engineering” storage pool that is present in a different zone and with its desired default parameters. 

Within a single backend definition, I now have 2 unique pools of storage that can be referenced in my StorageClasses. Here’s what they would look like:

--- 
apiVersion: storage.k8s.io/v1 
kind: StorageClass 
metadata: 
  name: engineering-sc 
provisioner: netapp.io/trident 
parameters: 
  selector: "department=engineering" 
--- 
apiVersion: storage.k8s.io/v1 
kind: StorageClass 
metadata: 
  name: legal-sc 
provisioner: netapp.io/trident 
parameters: 
  selector: "department=legal"

My StorageClasses reference the labels defined in the backend.json file under the parameters.selector section. Requests for “engineering-sc” will map to the “engineering” storage pool, and accordingly for “legal-sc”.

This way, you can define multiple pools of storage in your backend definition. If you already have Virtual Storage Pools defined on your backend, do not edit their orders or modify them to add new parameters. Rather, create a new virtual pool that includes the desired options.

Questions and Resources 

You can get the 20.01 release from our GitHub website here. There are sample backend definitions in the trident-installer/sample-input directory that will help you get started with defining Virtual Pools and the documentation provides a detailed description too. Join us on our Slack channel for questions!

 

Bala RameshBabu
Bala is a Technical Marketing Engineer who focuses on Trident, NetApp's dynamic storage provisioner for Kubernetes and Docker. With a background in OpenStack, he focuses on open-source solutions and DevOps workflows. When not at work, you can find him in a soccer field or reading biographies

Pin It on Pinterest