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, VIP 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. This means that there must be at least one VAST Cluster view defined along the path; for example, at /a
, /a/b
, or a/b/c
).
During initial deployment of VAST CSI Driver, you define one or more storage classes in the VAST CSI Driver chart configuration file. Later you can add more storage classes by creating and applying a Kubernetes YAML configuration file.
To add a storage class using a Kubernetes YAML configuration file:
-
Create a YAML configuration file that defines a new storage class and specify the following required parameters (see the example below for correct indentation and line breaks when specifying the keywords):
-
metadata: name:
Specify the name for the new storage class. -
parameters: vip_pool_name:
This is the name of the VAST VIP pool to be used when mounting the volume. -
parameters: root_export:
This is the path in the storage system where the volume directory is created. -
parameters: view_policy:
This is the view policy that will be assigned to VAST Cluster views that VAST CSI Driver creates for the volumes being provisioned.
The following example shows creating a storage class named
vastdata-filesystem-2
that uses path/k8s-2
, view policydefault
, and VIP pooltest1
. In the example, no custom mount options are set (mountOptions
is an empty string). The volumes created will be named using the following format:csi:{namespace}:{name}:{id}
.kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: vastdata-filesystem-2 namespace: vast-csi provisioner: csi.vastdata.com parameters: vip_pool_name: 'test1' root_export: '/k8s-2' view_policy: 'default' volume_name_fmt: csi:{namespace}:{name}:{id} mountOptions: - '' allowVolumeExpansion: true
-
-
Deploy 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
You can specify storage class options as follows:
-
In the Helm chart configuration file created for VAST CSI Driver during initial deployment, or
-
In a Kubernetes YAML configuration file deployed at a later stage.
Option in Helm chart configuration file |
Option in Kubernetes YAML configuration file |
Description |
---|---|---|
|
|
The name of the virtual IP pool to be used by VAST CSI Driver. |
|
|
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. |
|
|
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 about VAST Cluster view policies, see Managing Views and View Policies. The view policy cannot have the Root Squash setting enabled. All view policies used with VAST CSI Driver must have the same security flavor. |
|
|
A format string that controls naming of volumes created through VAST CSI Driver. The default format is |
|
|
A format string that controls naming of Kubernetes ephemeral volumes created through VAST CSI Driver. |
|
|
Specify any custom NFS mount options. Examples: mountOptions: - "proto=rdma" - "port=20049" mountOptions: - debug - nosuid - soft mountOptions: - nfsvers=4 NoticeNFSv4.1 is supported starting with VAST CSI Driver 2.2.1. |
Comments
0 comments
Article is closed for comments.