VAST CSI Operator for Kubernetes helps deploy, configure and upgrade VAST CSI drivers in Kubernetes environments.
To deploy VAST Block CSI Driver using VAST CSI Operator for Kubernetes:
Note
Before you start, ensure that the VAST cluster on which you are going to provision storage is configured for CSI use.
Follow VAST CSI Operator installation guidelines to install VAST CSI Operator.
The VAST CSI Operator will be installed into the
my-vast-csi-operatornamespace. Follow these guidelines to handle namespaces.Use VAST CSI Operator to deploy the VAST Block CSI Driver custom resources:
VastCSIDriver,VastClusterandVastStorage.Each of the three resources is required.
Use the storage class generated by the
VastStoragecustom resource instance in your PVCs to provision storage.
Note
VAST CSI Operator does not provide a CRD for VAST snapshots. If you are going to use VAST snapshots with VAST Block CSI Driver, install the snapshot CRDs manually.
Specifying the Namespace
By default, VAST CSI Operator for Kubernetes is installed into the my-vast-csi-operator namespace and can be run from that namespace only. To ensure that VAST CSI Driver runs in the same namespace as the VAST CSI Operat, do either of the following:
Remove
my-vast-csi-operatorfrom thetargetNamespacesspecification in the manifest produced during the installation, orInstall VAST CSI Driver to the
my-vast-csi-operatornamespace.
Custom Resource Definitions in VAST CSI Operator
VAST CSI Operator introduces the following Custom Resource Definitions (CRD):
VastCSIDriveris a common specification for the VAST CSI Controller and VAST CSI Node, for example:apiVersion: storage.vastdata.com/v1 kind: VastCSIDriver metadata: name: block.csi.vastdata.com namespace: vast-csi spec: driverType: "block" image: csiVastPlugin: repository: docker.io/vastdataorg/csi:v2.6.3
Ensure that the specification includes the correct driver type for VAST Block CSI Driver:
driverType: "block". (If not specified, the parameter defaults tonfs.)VastClusterspecifies the VAST endpoint, username and password to connect to the VAST cluster where volumes will be provisioned. These settings are stored in a VAST Block CSI Driver's Kubernetes secret.The specification can include either a VMS authentication token, or a username and a password.
For example:
With a VMS authentication token:
apiVersion: storage.vastdata.com/v1 kind: VastCluster metadata: name: cluster namespace: vast-csi spec: endpoint: 198.151.100.12 token: "<token>"
With a username and password:
apiVersion: storage.vastdata.com/v1 kind: VastCluster metadata: name: cluster namespace: vast-csi spec: endpoint: 198.151.100.12 username: admin password: "<password>"
You can create multiple
VastClusterinstances to access different VAST clusters, or to access the same VAST cluster using different credentials.VastStoragedefines VAST storage options to be used when provisioning volumes on the VAST cluster. This resource generates a storage class (and optionally a snapshot class) that you can use in your PVCs.For example:
apiVersion: storage.vastdata.com/v1 kind: VastStorage metadata: name: vastdata-block namespace: vast-csi spec: driverType: "block" provisioner: "block.csi.vastdata.com" clusterName: vastcluster subsystem: "myblock" vipPool: "vippool-1" createSnapshotClass: false
Using VastStorage-generated Storage Class in PVCs
In your PVC, specify the name of the storage class generated based on the VastStorage CRD as the storageClassName, for example:
For example:
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: csi-block-pvc spec: volumeMode: Block accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: vastdata-block