VAST CSI Driver supports multiple Kubernetes storage classes, enabling you to provision multiple storage paths within VAST Cluster, each configured (via VMS) with its own set of access policies, path protection, or replication policies. Each storage class can have its own path, virtual IP pool, a set of mount options, and other parameters.
A storage path is a path within VAST Cluster where VAST CSI Driver will create volume directories. The storage path is specified in the root_export parameter in the YAML configuration file; for example: /a/b/c. (Note that '/' cannot be used as a storage path.) The storage path must be mountable by VAST CSI Driver.
During initial deployment of VAST CSI Driver, you define one or more storage classes in the VAST CSI Driver Helm chart configuration file. Later you can add more storage classes by creating and applying a Kubernetes YAML configuration file.
Adding a Storage Class
To add a storage class using a Kubernetes YAML configuration file:
Create a YAML configuration file that defines a new storage class with the following required parameters:
Note
For a complete list of options that can be specified for a storage class, see Storage Class Option Reference.
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: <storage class name> provisioner: csi.vastdata.com parameters: subsystem: <NVMe subsystem name> vip_pool_fqdn: <virtual IP pool FQDN> | vip_pool_name: <virtual IP pool name> root_export: '/k8s-2' view_policy: 'default' <optional: pairs of secrets and secret namespaces for each volume processing stage>
The following example shows creating a storage class named
vastdata-filesystem-2that uses path/k8s-2, view policydefault, and virtual IP pooltest1. In the example, no custom mount options are set (mountOptionsis an empty string).Tip
For more examples, see https://github.com/vast-data/vast-csi/tree/v2.4/examples/csi.
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: vastdata-filesystem-2 provisioner: csi.vastdata.com parameters: csi.storage.k8s.io/controller-expand-secret-name: vast-mgmt csi.storage.k8s.io/controller-expand-secret-namespace: default csi.storage.k8s.io/controller-publish-secret-name: vast-mgmt csi.storage.k8s.io/controller-publish-secret-namespace: default csi.storage.k8s.io/node-publish-secret-name: vast-mgmt csi.storage.k8s.io/node-publish-secret-namespace: default csi.storage.k8s.io/node-stage-secret-name: vast-mgmt csi.storage.k8s.io/node-stage-secret-namespace: default csi.storage.k8s.io/provisioner-secret-name: vast-mgmt csi.storage.k8s.io/provisioner-secret-namespace: default vip_pool_fqdn: 'MyDomain' root_export: '/k8s-2' view_policy: 'default' volume_name_fmt: csi:{namespace}:{name}:{id} mountOptions: - '' allowVolumeExpansion: trueDeploy the YAML configuration file:
kubectl apply -f <filename>.yaml
Verify that the storage class has been added:
kubectl get storageclasses
The output is similar to the following:
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE standard (default) k8s.io/minikube-hostpath Delete Immediate false 4d1h vastdata-filesystem (default) csi.vastdata.com Delete Immediate true 58m vastdata-filesystem-2 (default) csi.vastdata.com Delete Immediate true 56m vastdata-filesystem-3 (default) csi.vastdata.com Delete Immediate true 54m
Storage Class Option Reference
You can specify storage class options as follows:
In the Helm chart configuration file created for VAST CSI Driver during initial deployment,
In a Kubernetes YAML configuration file deployed at a later stage.
Option in Helm chart configuration file | Option in Kubernetes YAML configuration file | Description |
|---|---|---|
|
| A format string that controls naming of Kubernetes ephemeral volumes created through VAST CSI Driver. If not specified, the default format |
|
| Specify NFS mount options for VAST CSI Driver to use when mounting a volume for a PVC with this storage class. Examples: mountOptions: - "proto=rdma" - "port=20049" mountOptions: - debug - nosuid - soft mountOptions: - nfsvers=4
|
|
| A Quality of Service (QoS) policy to be associated with automatically created views. In a QoS policy, you can set limits to define minimum and maximum allowed bandwidth and/or IOPS for read and/or write operations per view. For more information, see Configure a QoS Policy. |
|
| These options lets you supply information for communicating with the VAST cluster:
If the secret and its namespace are defined as global options in the Helm chart configuration file, they are automatically propagated to each storage class and each provisioning stage therein. In this case, you do not need to explicitly include the per-stage secrets with their corresponding namespaces in the storage class definition. If no global settings exist for the secret and its namespace, you need to specify them directly in the storage class definition in the following format. Note that you can specify a different value for each stage: csi.storage.k8s.io/controller-expand-secret-name: <secret name> csi.storage.k8s.io/controller-expand-secret-namespace: <secret namespace> csi.storage.k8s.io/controller-publish-secret-name: <secret name> csi.storage.k8s.io/controller-publish-secret-namespace: <secret namespace> csi.storage.k8s.io/node-publish-secret-name: <secret name> csi.storage.k8s.io/node-publish-secret-namespace: <secret namespace> csi.storage.k8s.io/node-stage-secret-name: <secret name> csi.storage.k8s.io/node-stage-secret-namespace: <secret namespace> csi.storage.k8s.io/provisioner-secret-name: <secret name> csi.storage.k8s.io/provisioner-secret-namespace: <secret namespace> |
|
| The storage path within VAST Cluster to be used when dynamically provisioning Kubernetes volumes. VAST CSI Driver will automatically create a VAST Cluster view for each volume being provisioned.
This option is required when defining a storage class in the Helm chart configuration file. |
|
| The name of the VAST Cluster view policy to be assigned to VAST Cluster views created by VAST CSI Driver. A view policy defines access settings for storage exposed through a VAST Cluster view. For more information, see Configure View Policies. All view policies used with VAST CSI Driver must have the same security flavor. If you are going to use VAST CSI Driver with VAST Cluster 4.6 or later, a view policy set for a storage class must belong to the same VAST Cluster tenant as the virtual IP pool(s) specified for that storage class. This option is required when defining a storage class in the Helm chart configuration file. |
|
| The name of the virtual IP pool to be used by VAST CSI Driver. For more information, see Set up Virtual IP Pools. If you are going to use VAST CSI Driver with VAST Cluster 4.6 or later, a virtual IP pool that you specify for a storage class must belong to the same VAST Cluster tenant as the view policy specified for this storage class. Either |
|
| The domain name of the virtual IP pool to be used by VAST CSI Driver. For more information, see Set up Virtual IP Pools. Either |
|
| A format string that controls naming of volumes created through VAST CSI Driver. If not specified, the default format |