Use one of the following methods to deploy VAST Block CSI Driver:
VAST Block CSI Driver Requirements
Ensure that your environment meets the following requirements:
-
A Kubernetes cluster is up and running.
-
A VAST cluster is up and running.
-
All nodes of the Kubernetes cluster are networked with the VAST cluster and can attach VAST cluster volumes via NVMe.
-
At least one node can communicate with the VAST Cluster management virtual IP.
-
A host is available with a Helm client installed, preferably in the VMS network.
-
The
nvme-clipsackage is installed on Kubernetes nodes where volumes are to be attached.
Supported Versions
VAST Block CSI Driver 2.6.x requires:
-
Helm 3.x.x
-
Kubernetes 1.25 - 1.36
-
VAST Cluster 5.3 or later
-
To replicate block volumes: 5.5.0 or later
-
To specify a VAST cluster tenant on which to provision storage: 5.3.3 or later
-
Required Permissions
VAST Block CSI Driver requires root (sysadmin) privileges.
Deploy VAST Block CSI Driver with a Helm Chart
Before you begin, ensure that your environment meets the requirements.
The following procedure uses a Helm chart to deploy the driver. A Helm chart is an installation template that can be reused to install multiple instances of the software being deployed. Each instance is referred to as a release. Helm charts are available from Helm repositories.
Steps to deploy VAST Block CSI Driver include:
-
Install Custom Resource Definitions for snapshots.
Note: This step is required if the driver's Helm chart configuration file (
values.yaml) hassecretNameandEndpointspecified as global options (on top ofvalues.yaml). This step is optional only whensecretNameandsecretNamespaceare specified within one or more storage classes (or underStorageClassDefaults). -
(Optional) Create a Kubernetes namespace for VAST Block CSI Driver.
Note: This step is required if you are going to deploy VAST Block CSI Driver in a Kubernetes namespace other than
default. Otherwise, skip to step 2. -
Configure the VAST cluster.
-
Create a Kubernetes secret with VMS user credentials or API token for VAST Block CSI Driver.
-
Add the Helm repository that contains the VAST Block CSI Driver chart.
-
Create a Helm chart configuration file for VAST Block CSI Driver.
-
Install the Helm chart for VAST Block CSI Driver.
Install CRDs for VAST Snapshots
CRDs for VAST snapshots are a prerequisite for using VAST snapshots. The CRDs are required if your deployment includes one or more snapshot classes.
The driver's logic for creating snapshot classes varies depending on whether you specify the Kubernetes secret as a global or a storage class-specific option:
-
If the driver's Helm chart configuration file (
values.yaml) hassecretNameandEndpointspecified as global options (on top ofvalues.yaml), the driver follows legacy logic and creates one snapshot class namedvastdata-snapshotto be used for all PVCs. This configuration requires that you install the CRDs for VAST snapshots during driver deployment. -
When
secretNameandsecretNamespaceare specified within one or more storage classes (or underStorageClassDefaults), the driver creates snapshot classes only when they are defined explicitly. This means that in this case, you need to install the CRDs for VAST snapshots only when you have an explicitsnapshotClassdefinition in place.
Run the following commands to install the CRDs for snapshots:
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v7.0.1/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v7.0.1/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v7.0.1/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v7.0.1/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v7.0.1/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
Create Kubernetes Namespace for VAST Block CSI Driver
By default, VAST Block CSI Driver is deployed to the default namespace on the Kubernetes cluster.
If you want to use a different Kubernetes namespace for VAST Block CSI Driver, create it prior to deployment by running the following command:
kubectl create ns <namespace_name>
Configure VAST Cluster for VAST Block CSI Driver
Complete the following steps to make your VAST cluster ready for integration with Kubernetes:
-
(Optionally) With VAST Cluster 5.3.3 or later, if you are going to provision storage on a particular VAST tenant, create a tenant that will host the block volumes.
-
Create a VAST cluster view that VAST Block CSI Driver will use to provision block volumes.
-
Set up virtual IP pools to be used by VAST Block CSI Driver.
-
Set up a VMS user to be used by VAST Block CSI Driver.
-
(Optional) Upload your CA-signed SSL certificate to the VAST cluster.
-
(Optional): Configure a QoS policy to be associated with views created by VAST Block CSI Driver.
Create Tenant for Dynamic Volume Provisioning
If you run the driver with VAST Cluster 5.3.3 or later, it is recommended to set up a dedicated VAST Cluster tenant for dynamic volume provisioning to allow for control plane isolation of privileges that would prevent the service account used by the driver from acting outside the scope of dynamic provisioning.
For more information about support of multiple VAST tenants by the driver, see Support of VAST Cluster Multi-Tenancy for Block Storage.
To create a tenant in VAST Web UI, log in and choose Element Store -> Tenants in the main navigation menu. Click Create Tenant and follow the tenant creation guidelines in VAST Cluster Administrator's Guide.
Create View for Block Volumes
Create a view that will expose the NVMe subsystem that VAST Block CSI Driver will use to to provision block volumes. The view must have the block storage protocol enabled and the NVMe subsystem defined.
With VAST Cluster 5.3.3 or later, if you've created a dedicated tenant for dynamic volume provisioning, ensure that the view belongs to the dedicated tenant.
To view and manage views in VAST Web UI, log in and choose Element Store -> Views in the main navigation menu. For more information about VAST Cluster views, see VAST Cluster Administrator's Guide.
Set Up Virtual IP Pools
VAST Block CSI Driver distributes the load among virtual IPs in one or more VAST virtual IP pools.
You specify a virtual IP pool in the storageClass definition. The virtual IP pool specified for a storage class is used to process read and write operations requested by the application that is using that particular class.
Ensure that the virtual IP pool set for a storage class belongs to the same VAST Cluster tenant as the view that exposes the NVMe subsystem specified for that storage class.
In the driver's Helm chart configuration file, the virtual IP pool can be specified by its name (vipPool) or FQDN (vipPoolFQDN). If you are going to use the FQDN, ensure that the VAST cluster has DNS configured, and the virtual IP pool has Virtual IP Pool Domain Name defined in its settings.
To view and manage virtual IP pools in VAST Web UI, log in and choose Network Access -> Virtual IP Pools in the main navigation menu. For more information about VAST Cluster virtual IP pools, see VAST Cluster Administrator's Guide.
Set Up VMS User
Set up a VMS user for VAST Block CSI Driver to communicate with the VAST Management Service (VMS) via VAST REST API.
You'll need to supply the VMS user's credentials (username and password) or API token in a Kubernetes secret that is specified when creating the driver's Helm chart configuration file.
To set up a VMS user for VAST Block CSI Driver:
-
Create a new role (in VAST Web UI: Administrators -> Roles -> Create Role) that grants the Create, View, Edit and Delete permissions in the Logical realm.
Note: Do not use the
csirole provided with the cluster. -
Create a new VMS manager user for VAST CSI Driver (in VAST Web UI: Administrators -> Managers -> Create Manager) and assign the newly created role to this user.
Note: Alternatively, assign the newly created role to the
adminuser provided with the cluster.With VAST Cluster 5.3.3 or later, if you are going to provision storage on a particular VAST tenant, set the User type to Tenant Admin and select the desired tenant from the dropdown list. This is the tenant you'll need to specify in the driver's Kubernetes secret.
-
If you want to have the user authenticated with a VMS API token instead of a password, generate the token as follows:
-
If the user is a Cluster Admin, run the
apitoken createcommand of VAST CLI. -
If the user is a Tenant Admin, with VAST Cluster 5.3.3 or later:
-
Install
vastpyandvastpy-clitools with the following command (which installs both tools):pip install vastpy -
Run the following command to generate the VMS API token:
vastpy-cli --user <username of tenant admin user> \ --password '<password of tenant admin user>' \ --tenant-name <tenant name> \ post apitokens owner=<username of tenant admin user> name=<token name>For example:
vastpy-cli --user admina \ --password 'P@ssw0rd' \ --tenant-name ten-a \ post apitokens owner=admina name=new‑token9898
-
-
Upload CA-Signed SSL Certificate to VAST Cluster
If you want to use a Certificate Authority-signed SSL certificate to secure the connection to the VAST cluster, follow the SSL certificate upload procedure in the VAST Cluster Administrator's Guide to upload your SSL certificate to the VAST cluster.
For more information about configuring SSL encryption for VAST Block CSI Driver, see Configuring SSL Encryption for VAST Block CSI Driver.
Configure QoS Policy
You can optionally set up a Quality of Service (QoS) policy to be associated with the views that VAST Block CSI Driver creates. A QoS policy is specified per Kubernetes storage class configured for the VAST driver.
Note: This capability requires VAST Cluster 5.4 or later.
To view and manage QoS policies via VAST Web UI, log in and choose Element Store -> QoS Policies. For more information about VAST Cluster QoS policies, see VAST Cluster Administrator's Guide.
Create Kubernetes Secret for VAST Block CSI Driver
Create a Kubernetes secret to keep VMS user credentials or API token that VAST Block CSI Driver uses to communicate with the VAST cluster. You need to supply the name of the secret when creating the driver's Helm chart configuration file.
You can create one or more Kubernetes secrets that can be specified individually per storage class or snapshot class. Each of these Kubernetes secrets specifies the VAST cluster to connect to and the VMS user credentials or API token, enabling you to provision volumes on multiple VAST clusters or using multiple VMS users on the same VAST cluster.
Tip: The secret can be used not only when there are multiple VAST clusters, but also anytime when the
secretNameandsecretNamespaceparameters in the Helm chart configuration file (values.yaml) are specified within a storage class or underStorageClassDefaults.
Do either of the following:
Using VMS authentication tokens is recommended over supplying VMS user credentials.
Create Secret with VMS API Token (Recommended)
Note: VMS authentication tokens are supported with VAST Cluster 5.3 or later.
To create a Kubernetes secret with the VMS user's API token:
-
Create a YAML file with the following content:
apiVersion: v1 kind: Secret metadata: name: <secret name> type: Opaque data: endpoint: <VAST cluster hostname> tenant: <VAST tenant name> token: <VMS user's token> sslCert: <path to SSL certificate> passphrase: <LUKS passphrase>Where:
-
(Required)
nameis the name of the Kubernetes secret. -
(Required)
endpointsets the hostname FQDN or IP address of the VMS URL of the VAST cluster where you want to provision block volumes. -
(Optional)
tenantlets you connect to a particular VAST cluster tenant. Supplying a tenant requires that the VMS user has a user type of Tenant Admin for the specified tenant (in VAST Web UI: Administrators -> Managers -> open manager details -> User type: Tenant Admin).Note: The
tenantparameter is supported starting with VAST Block CSI Driver 2.6.3. -
(Required)
tokenis the VMS API token of the VMS user to connect to the VAST cluster. The token must be Base64-encoded. -
(Optional)
sslCertis only required if you are using SSL encryption with a self-signed SSL certificate. It specifies the path to the SSL certificate. -
(Optional)
passphraseenables LUKS-based host encryption and sets the LUKS passphrase to be used to encrypt and decrypt the block device. This parameter is available starting with VAST CSI 2.6.3.
-
-
Apply the YAML file:
kubectl apply -f <path to the YAML file>Note: If you are creating the secret in a namespace that is different from the namespace used to install the driver's Helm chart, specify the secret's namespace on the command:
-n <secret's namespace>.
Alternatively, you can create a secret with the following command:
kubectl create secret generic <secret name> \
--from-literal=endpoint='vms.example.com' \
--from-literal=tenant='<VAST tenant name>' \
--from-literal=token='<VMS user token>' \
--from-file=ssl_cert='<path to SSL certificate>' \
--from-literal=passphrase='<LUKS passphrase>' \
-n <secret's namespace>
For example:
kubectl create secret generic vast-mgmt \
--from-literal=endpoint='vms.example.com' \
--from-literal=tenant='Operations' \
--from-literal=token='xxxxxxxxxххххххххххххххххххххххххххххххх' \
--from-file=ssl_cert='VastCerts/RootCA.crt' \
-n secret_namespace
Create Secret with VMS User Credentials
To create a Kubernetes secret with VMS user credentials:
-
Create a YAML file with the following content:
apiVersion: v1 kind: Secret metadata: name: <secret name> type: Opaque data: endpoint: <VAST cluster hostname> tenant: <VAST tenant name> username: <VMS user's username> password: <VMS user's password> sslCert: <path to SSL certificate> passphrase: <LUKS passphrase>Where:
-
(Required)
nameis the name of the Kubernetes secret. -
(Required)
endpointsets the hostname FQDN or IP address of the VMS URL of the VAST cluster where you want to provision block volumes. -
(Optional)
tenantlets you connect to a particular VAST cluster tenant. Supplying a tenant requires that the VMS user has a user type of Tenant Admin for the specified tenant (in VAST Web UI: Administrators -> Managers -> open manager details -> User type: Tenant Admin).Note: The
tenantparameter is supported starting with VAST Block CSI Driver 2.6.3. -
(Required)
usernameis the username of the VMS user to connect to the VAST cluster. The username must be Base64-encoded. -
(Required)
passwordis the password for the VMS user connecting to the VAST cluster. The password must be Base64-encoded. -
(Optional)
sslCertis only required if you are using SSL encryption with a self-signed SSL certificate. It specifies the path to the SSL certificate. -
(Optional)
passphraseenables LUKS-based host encryption and sets the LUKS passphrase to be used to encrypt and decrypt the block device. This parameter is available starting with VAST CSI 2.6.3.
-
-
Apply the YAML file:
kubectl apply -f <path to the YAML file>Note: If you are creating the secret in a namespace that is different from the namespace used to install the driver's Helm chart, specify the secret's namespace on the command:
-n <secret's namespace>.
Alternatively, you can create a secret with the following command:
kubectl create secret generic <secret name> \
--from-literal=endpoint='vms.example.com' \
--from-literal=tenant='<VAST tenant name>' \
--from-literal=username='<VMS user's username>' \
--from-literal=password='<VMS user's password>' \
--from-file=ssl_cert='<path to SSL certificate>' \
--from-literal=passphrase='<LUKS passphrase>' \
-n <secret's namespace>
For example:
kubectl create secret generic vast-mgmt \
--from-literal=endpoint='vms.example.com' \
--from-literal=tenant='Operations' \
--from-literal=username='user1' \
--from-literal=password='xxxxxxxxx' \
--from-file=ssl_cert='VastCerts/RootCA.crt' \
-n secret_namespace
Add Helm Repository for VAST Block CSI Driver
Add the Helm repository that contains the VAST Block CSI Driver Helm chart to the list of available repositories:
-
Add the Helm repository for VAST Block CSI Driver:
helm repo add <repo> https://vast-data.github.io/vast-csiSpecify any suitable name for
repo. This name will be used to refer to the VAST Block CSI Driver repository when running Helm commands. For example: vastblock -
Verify that the repository has been added:
helm repo listThe output is similar to the following:
NAME URL vastblock https://vast-data.github.io/vast-csi
Create Helm Chart Configuration File for VAST Block CSI Driver
The VAST Block CSI Driver's Helm chart configuration file lets you override default installation settings provided in the chart with parameters that are specific to your environment.
The configuration file is a YAML file typically named values.yaml, although you can use any arbitrary name for it.
Create Configuration File
Create a YAML file as follows (see also the example below):
Note: For a detailed reference for parameters and values, see here.
secretName: "<secret>"
verifySsl: true|false
sslCertsSecretName: "<SSL secret>"
StorageClassDefaults:
<option 1>
<option 2>
...
<option n>
storageClasses:
<storage class name 1>:
<option 1>
<option 2>
...
<option n>
<storage class name 2>:
<option 1>
<option 2>
...
<option n>
...
<storage class name n>:
<option 1>
<option 2>
...
<option n>
In the YAML file:
-
Set global or storage class-specific session options:
-
Global session options are specified in the beginning of the configuration file. They apply to all storage classes:
-
secretName: "<secret>"(required): Specify the Kubernetes secret that VAST Block CSI Driver will use to communicate with the VAST cluster. For more information, see Create Kubernetes Secret for VAST Block CSI Driver.The
secretNameglobal session option is required unless the secret name is provided, together withsecretNamespace, underStorageClassDefaultsor under a specific storage class. -
verifySsl: true|false(optional): Specifytrueto enable SSL encryption for the connection to the VAST cluster. If set tofalseor not specified, SSL encryption is disabled.Tip: When enabling SSL encryption, either upload a CA-signed SSL certificate to the VAST cluster, or supply a self-signed SSL certificate to the driver. The latter can be done either via the
sslCertsSecretNameoption, or using--set-file sslCerton the Helm chart installation command. -
sslCertsSecretName: "<SSL secret>"(optional): Specify the Kubernetes secret that contains the self-signed SSL certificate to be used to secure communications between VAST Block CSI Driver and the VAST cluster. For more information, see Configure SSL Encryption for VAST Block CSI Driver. -
blockHostsAutoPrune: true|false(optional): If set to true, VAST Block CSI Driver automatically deletes auto-generated VAST host entries (NQNs that were automatically created by the driver) when they are no longer in use by any PVCs on the corresponding Kubernetes node. If set to false (default), unused host entries keep accumulating and need to be deleted manually.Note: This parameter is available starting with VAST Block CSI Driver 2.6.4.
-
-
Storage class-specific session options are specified under a certain storage class (in step 2). They apply to that particular storage class only, taking precedence over global session options.
-
-
Set storage class options:
-
<storage class name>(required): Provide a name to identify the storage class. For more information about Kubernetes storage classes, see Create Block Storage Classes.Note: Define at least one storage class.
-
<option 1>...<option n>: Specify parameters to be used when provisioning storage for PVCs with this storage class. For information on each option, see Storage Class Option Reference.The required options for block storage provisioning are as follows:
storageClasses: <storage class name>: vipPoolFQDN: "<pool FQDN>" | vipPool: "<pool name>" subsystem: "<NVMe subsystem>"If you want to configure storage class-specific session options, add the following parameters:
-
secretName(required if no global session options are set): The name of the Kubernetes secret that contains information about the VAST cluster on which to provision volumes for this particular storage class, the corresponding VMS user credentials or API token and, optionally, the SSL certificate. For more information, see Provision Block Volumes on Multiple VAST Clusters. -
secretNamespace(optional): If the storage class Kubernetes secret (specified onsecretName) was created in a namespace that is different from that used to install the driver's Helm chart, add this parameter to specify the namespace of the Kubernetes secret.
-
-
-
(Optional) Configure registration of VAST Block CSI Driver driver with
kubelet:kubeletPath: "<your kubelet root directory>"(optional): Add this option if you are going to run VAST CSI Block CSI Driver on a Kubernetes cluster where the kubelet root directory is not/var/lib/kubelet.
The following snippet shows a sample configuration file for VAST Block CSI Driver:
secretName: "vast-mgmt"
verifySsl: true
storageClasses:
vastdata-filesystem:
vipPool: "vippool-1"
subsystem: "mysubsystem"
Verify Configuration File
Verify the newly created chart configuration file:
helm template <release name> <repo>/<chart> -f <filename>.yaml -n <namespace>
Where:
-
<release name>identifies the release being deployed. -
<repo>is the name of the driver's Helm repository. -
<chart>is the name of the driver's Helm chart (vastblock). -
<filename>.yamlis the driver's Helm chart configuration file. -
<namespace>determines the Kubernetes namespace to which the release is deployed. If this parameter is not specified, thedefaultnamespace is used. Otherwise, create a custom namespace prior to installing the driver's Helm chart.
For example:
helm template csi-driver vastblock/vastblock -f values.yaml
The output is similar to the following:
---
# Source: vastcsi/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-vast-controller-sa
namespace: "default"
labels:
helm.sh/chart: vastblock-0.1.0
app.kubernetes.io/name: vastblock
app.kubernetes.io/instance: csi-driver
app.kubernetes.io/version: "2.6.1"
app.kubernetes.io/managed-by: Helm
---
# Source: vastcsi/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
<...>
Install VAST Block CSI Driver Helm Chart
Installing a Helm chart results in deployment of a VAST driver's release in your Kubernetes environment. A release is identified with its release name, which you supply during the install.
To install the VAST Block CSI Driver Helm chart:
-
Refresh Helm repository information:
helm repo update -
Run the following command to initiate the install:
helm install <release name> <repo>/<chart> -f <filename>.yaml -n <namespace> [--set-file sslCert=VastCerts/RootCA.crt]Where:
-
<release name>identifies the release being deployed. -
<repo>is the name of the VAST Block CSI Driver Helm repository. -
<chart>is the name of the Helm chart to be installed (vastblock). -
<filename>.yamlis the Helm chart configuration file for VAST Block CSI Driver. -
<namespace>(optional) determines the Kubernetes namespace to which the release is deployed. If this parameter is not specified, thedefaultnamespace is used. Otherwise, create a custom namespace prior to installing the Helm chart. -
--set-file sslCert=VastCerts/RootCA.crt(optional) specifies the path to a self-signed SSL certificate to secure the connection to the VAST cluster.
For example:
helm install csi-driver vastblock/vastblock -f values.yamlThe output is similar to the following:
NAME: csi-driver LAST DEPLOYED: Thu Dec 5 05:24:36 2024 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: Thank you for installing vastblock. Your release is named csi-driver. The release is installed in namespace default To learn more about the release, try: $ helm status -n default csi-driver $ helm get all -n default csi-driver <...> -
-
Verify that the Helm chart has been installed as follows:
-
Check the release status with the following command:
helm status -n <namespace> <release name>For example:
helm status -n default csi-driver -
Ensure that the release appears in the list of releases:
helm list -n <namespace>For example:
helm list -n defaultThe output is similar to the following:
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION csi-driver default 1 2024-12-04 04:25:33.783236165 +0000 UTC deployed vastblock-0.1.0 2.4.0
-
Deploy VAST Block CSI Driver with VAST CSI Operator for Kubernetes
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.
1. Follow [VAST CSI Operator installation guidelines](https://operatorhub.io/operator/vast-csi-operator) to install VAST CSI Operator.
The VAST CSI Operator will be installed into the `my-vast-csi-operator` namespace. Follow [these guidelines](#specify-namespace) to handle namespaces.
2. Use VAST CSI Operator to deploy the VAST Block CSI Driver [custom resources](#custom-resource-definitions-in-vast-csi-operator): `VastCSIDriver`, `VastCluster` and `VastStorage`.
Each of the three resources is required.
3. [Use](#use-vaststoragegenerated-storage-class-in-pvcs) the storage class generated by the `VastStorage` custom 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.
Specify 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 Operator, do either of the following:
-
Remove
my-vast-csi-operatorfrom thetargetNamespacesspecification in the manifest produced during the installation, or -
Install 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.3Ensure 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 API token, or a username and a password.
For example:
-
With a VMS API 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
Use 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
Deploy VAST Block CSI Driver on OpenShift with VAST CSI Operator
VAST CSI Operator is an OpenShift operator that helps deploy, configure and upgrade VAST CSI drivers in Red Hat OpenShift environments.
To deploy VAST Block CSI Driver using VAST CSI Operator:
Note: Before you start, ensure that the VAST cluster on which you are going to provision storage is configured for CSI use.
1. Follow [OpenShift Operator guidelines](https://catalog.redhat.com/software/container-stacks/detail/5f74e44ee13f2c4bdca41b30#deploy%20&%20use) to install VAST CSI Operator.
2. Use VAST CSI Operator to deploy the VAST Block CSI Driver [custom resources](#custom-resource-definitions-in-vast-csi-operator): `VastCSIDriver`, `VastCluster` and `VastStorage`.
Each of the three resources is required.
3. [Use](#use-vaststoragegenerated-storage-class-in-pvcs) the storage class generated by the `VastStorage` custom resource instance in your PVCs to provision storage.
4. [Assign](#assign-sccs-to-vast-block-csi-driver) OpenShift Security Context Constraints (SCCs) to VAST Block CSI Driver.
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.
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.4Ensure 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
Use 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
Assign SCCs to VAST Block CSI Driver
Assign OpenShift Security Context Constraints (SCC) to VAST Block CSI Driver service accounts so that VAST Block CSI Driver is able to create mount points on the host machine:
oc adm policy add-scc-to-user privileged -z <release name>-vast-controller-sa -n <namespace name>
oc adm policy add-scc-to-user privileged -z <release name>-vast-node-sa -n <namespace name>
Where:
-
<release name>identifies the VAST Block CSI Driver release being deployed. -
<namespace name>is the namespace to which VAST Block CSI Driver will be deployed.
For example:
oc adm policy add-scc-to-user privileged -z csi-vast-controller-sa -n vastcsi
oc adm policy add-scc-to-user privileged -z csi-vast-node-sa -n vastcsi
Configure SSL Encryption for VAST Block CSI Driver
You can secure the connection between VAST Block CSI Driver and the VAST cluster with SSL encryption as follows:
-
Enable SSL encryption.
-
Do one of the following to install an SSL certificate:
-
If you want to use a Certified Authority-signed SSL certificate, upload it to the VAST cluster. Follow the SSL certificate upload procedure provided in the VAST Cluster Administrator's Guide.
-
If you want to use a self-signed SSL certificate, supply it to VAST Block CSI Driver.
-
Enable SSL Encryption
By default, SSL encryption is disabled.
To enable SSL encryption:
-
Add the
verifySsl=trueoption to the VAST Block CSI Driver's Helm chart configuration file, for example:secretName: "vast-mgmt" endpoint: "my.endpoint" verifySsl: true <...> -
Install or upgrade the driver's Helm chart.
Upload CA-Signed SSL Certificate to VAST Cluster
Follow the guidelines provided in the VAST Cluster Administrator's Guide to upload a CA-signed SSL certificate to the VAST cluster.
Supply Self-Signed SSL Certificate to VAST Block CSI Driver
You can either point to a file that contains a self-signed SSL certificate file, or specify an existing Kubernetes secret that contains the certificate. These two methods are mutually exclusive.
Do either of the following:
-
Install or upgrade the driver's Helm chart with the
--set-file sslCert=<path to certificate file>option specified, for example:helm install csi-driver vast/vastblock -f values.yaml --set-file sslCert=<path to certificate file>
OR
-
Create a Kubernetes secret with the SSL certificate and specify the secret using the
sslCertsSecretNameoption in the VAST Block CSI Driver Helm chart configuration file:-
Create a Kubernetes secret that contains the SSL certificate, for example:
kubectl create secret generic vast-ca --from-file=ca-bundle.crt=<path to certificate file> -
Specify the newly created secret on the
sslCertsSecretNameoption in the VAST Block CSI Driver chart configuration file, for example:secretName: "vast-mgmt" endpoint: "my.endpoint" verifySsl: true sslCertsSecretName: "vast-ca" <...> -
Install or upgrade the VAST Block CSI Driver Helm chart (without specifying
--set-file sslCert).Install the VAST CSI Driver Helm Chart
-
Replace Self-Signed SSL Certificate for VAST Block CSI Driver
Choose either of the following, depending on how you supplied the old self-signed SSL certificate:
-
If you supplied the old SSL certificate using the
--set-file sslCertoption on the Helm chart install or upgrade command:-
Upgrade the driver's Helm chart with
--set-file sslCertpointing to the new SSL certificate file. For example:helm upgrade csi-driver vast/vastcsi -f values.yaml --set-file sslCert=<path to new certificate>
-
OR
-
If the old SSL certificate was supplied via
sslCertsSecretNamein the VAST Block CSI Driver's Helm chart configuration file:-
Create a new Kubernetes secret with the new SSL certificate:
kubectl create secret generic vast-ca-new --from-file=ca-bundle.crt=<path to new certificate file> -
Ensure that the new SSL certificate is specified on the
sslCertsSecretNameoption in the VAST Block CSI Driver's Helm chart configuration file:secretName: "vast-mgmt" endpoint: "my.endpoint" verifySsl: true sslCertsSecretName: "vast-ca-new" <...> -
Upgradethe driver's Helm chart, for example:
helm upgrade csi-driver vast/vastblock -f values.yaml
-
Remove Self-Signed SSL Certificate from VAST Block CSI Driver
Choose either of the following, depending on how you supplied the self-signed SSL certificate:
-
If you used
--set-file sslCertto supply the SSL certificate:-
Upgrade the driver's Helm chart without the
--set-file sslCertoption specified. For example:helm upgrade csi-driver vast/vastblock -f values.yaml
-
OR
-
If the old SSL certificate was supplied via
sslCertsSecretName:-
Remove the
sslCertsSecretNameoption from the VAST Block CSI Driver chart configuration file. -
Upgrade the driver's Helm chart (without specifying
--set-file sslCert), for example:helm upgrade csi-driver vast/vastblock -f values.yaml
-
Enable Host Encryption with VAST Block CSI Driver
Starting with version 2.6.3, VAST Block CSI Driver supports LUKS-based host encryption.
To enable host encryption, you specify a LUKS passphrase in the Kubernetes secret referenced in the driver's Helm chart configuration file using the passphrase parameter, for example:
apiVersion: v1
kind: Secret
metadata:
name: <secret name>
type: Opaque
data:
endpoint: <VAST cluster hostname>
token: <VMS user's token>
sslCert: <path to SSL certificate>
passphrase: <passphrase>
If a passphrase is supplied, VAST Block CSI Driver applies encryption with the following default parameters:
luks_type: "luks2" # LUKS version
cipher: "aes-xts-plain64" # Encryption cipher
key_size: "512" # Key size (in bits) for the cipher
hash: "sha256" # Hashing algorithm
pbkdf_memory: "65536" # Memory cost for PBKDF (in KB)
perf-same_cpu_crypt: true # Use same CPU for encryption work
perf-submit_from_crypt_cpus: true # Submit IO from crypt CPUs
perf-no_read_workqueue: true # Bypass read workqueue
perf-no_write_workqueue: true # Bypass write workqueue
Note: For more details on the parameter values, see Storage Class Option Reference.
You can override the defaults by supplying encryption parameters in the storage class definition, for example:
storageClasses:
vastdata-block:
subsystem: <subsystem>
viewPolicy: <view policy>
vipPool: <virtual IP pool>
secretName: <name of secret>
hostEncryption:
key_size: 256
Note: Enabling host encryption results in the entire device being encrypted, with the data available only when supplying the preset passphrase.
Run Multiple Instances of VAST Block CSI Driver
You can run multiple VAST Block CSI Driver instances on the same Kubernetes cluster.
To do so, deploy each instance under its own name specified on the csiDriverName parameter in the driver instance's Helm chart configuration file. Each driver instance needs to be deployed in its own namespace. After deployment, you can supply the driver instance name when specifying the provisioner for a storage class (or a snapshot class), as well as when supplying the driver name in your pod definition.
Note: The default instance name for VAST Block CSI Driver is
block.csi.vastdata.com.
For example, to deploy two driver instances named bcsi1.vastdata.com and bcsi2.vastdata.com:
-
Create a Helm chart configuration file for each of the instances and specify the instance name in it, for example:
-
For instance 1, create
bcsi1-values.yamlwith:csiDriverName: bcsi1.vastdata.com -
For instance 2, create
bcsi2-values.yamlwith:csiDriverName: bcsi2.vastdata.com
-
-
Install the Helm chart for driver instance 1 into the namespace designated for this instance, for example:
helm install csi-driver vastcsi/vastcsi -f bcsi1-values.yaml -n bcsi1 -
Install the Helm chart for driver instance 1 into into a namespace that is different from that used for instance 1, for example:
helm install csi-driver vastblock/vastblock -f bcsi2-values.yaml -n bcsi2
If the Helm chart configuration file contains a Kubernetes secret and its namespace specified as global parameters at the top of the file, a default snapshot class named vastdata-snapshot is automatically created during driver installation (unless you define a snapshot class explicitly in the snapshotClasses section of the file). In this case, since snapshot class names must be unique globally, an attempt to deploy the second driver instance may fail because the default snapshot class already exists. To avoid the failure, edit the Helm chart configuration file of the second driver instance being deployed as follows:
-
Add the
snapshotClassessection and define a snapshot class explicitly, or -
Remove the global secret and specify the secret(s) under each storage class (and each snapshot class, if defined).