Volcengine Kubernetes Engine (VKE) allows you to use vePFS through the Container Storage Interface (CSI). This topic describes how to create vePFS PersistentVolumes (PVs) and PersistentVolumeClaims (PVCs) and how workloads use dynamic vePFS PVs.
tip
[Beta - apply for trial]: Dynamic vePFS PV provisioning and the Intelligent Computing edition are in the beta stage. Submit an application if you need to use these features. Prerequisites
Usage limits
When you use vePFS, take note of the following limitations or impacts related to deployment compatibility, add-on uninstallation, service mounting, and operational performance.
Restrictions on deployment compatibility
- One vePFS mount service cannot be used for both the vePFS CSI solution and the solution where vePFS is pre-mounted to the host at the same time. For a vePFS file system instance, if you have used a VKE node to pre-mount vePFS and supplied it to pods through hostpath, you need to create an additional vePFS mount service and configure the new vePFS mount service for use by vePFS CSI.
- The solution for using vePFS through CSI and the solution for using vePFS through the vePFS-Manager add-on cannot be used at the same time. We recommend using the CSI solution for new clusters. To apply the latest CSI solution to existing resources, submit a ticket to the technical support.
- vePFS CSI controller will be preferentially scheduled to nodes that have the label vepfs.csi.volcengine.com/controller=preferred. To frequently scale the VKE cluster node pool, we recommend that you preferentially schedule the CSI controller to resident nodes, which are not affected by scaling. This ensures that vePFS CSI can quickly process member consistency between the VKE cluster and the vePFS cluster. Otherwise, when nodes running the vePFS CSI controller are scaled in and deleted, the vePFS CSI controller may be unable to maintain member consistency between the VKE cluster and the vePFS cluster, resulting in slow vePFS CSI operations.
- Nodes that have already been added to the vePFS cluster through the Virtual Private Cloud (VPC) network will not be able to use the RDMA network. To switch to the RDMA network, remove the VKE node from the vePFS file system cluster.
Restrictions on add-on uninstallation
- If the csi-vepfs add-on is uninstalled, running pods can continue to access vePFS storage until they finish running. However, if csi-vepfs has already been uninstalled, pod deletion will be blocked, and the pods can be deleted again after csi-vepfs is reinstalled. Therefore, we do not recommend that you uninstall the csi-vepfs add-on when pods are running.
- csi-vepfs enables the file system client to run in a dedicated container, and the vePFS client will occupy the computing resources of the Kubernetes node where the container is located. By default, the client uses 4 CPUs and 4 GiB of memory. If node resources are insufficient, both the csi-vepfs client container and the pod will fail to start.
- If you delete the vePFS mount service in advance, the vePFS CSI add-on cannot be uninstalled.
- After you delete the vePFS CSI add-on, you cannot confirm whether some resources can be deleted, which may result in residual resources.
- vePFS mount service secret: When you create a vePFS PV, VKE will also create a Secret that stores the addresses and login keys of the three management nodes of the vePFS mount service. You can run the following command to query the preceding Secret in the VKE cluster.
- Security groups on the VKE node: To ensure that the VKE node can communicate with the vePFS file system cluster, vePFS CSI will also add the security group of the management service ECS instance to the security group list of the VKE node. However, when CSI is being uninstalled, whether the security group is still being used by the user cannot be confirmed. Therefore, you cannot unbind the security group from the VKE node. You can view or delete the security group bound to the ECS node to which the vePFS mount service belongs in the ECS console.
Restrictions on service mounting
- A single vePFS instance can be bound to multiple mount services. A single mount service can also be bound to multiple vePFS instances.
- A single ECS instance can be added to only one vePFS mount service, which is equivalent to a client cluster. One mount service can be bound to multiple file system storage instances.
- A node can be bound to only one mount service. Therefore, we recommend that you bind one VKE cluster to one vePFS mount service.
- StorageClasses dynamically provision PVs by using filesets. Therefore, the number of PVs varies based on different types of filesets. For details, see Considerations on Fileset.
- vePFS does not support the use of images of Ubuntu and veLinux CentOS Compatible Edition. For detailed client restrictions, see Client restrictions.
Restrictions on operational performance
- The creation of dynamic PVs in a vePFS filesystem runs in serial mode. If multiple dynamic PVs are created simultaneously, the total creation time will be longer.
- The initial startup of a container that uses vePFS on a node is approximately 15 seconds slower than subsequent startups. This is because vePFS CSI needs to compile the kernel driver for vePFS on the node. This process consumes more time. However, this situation only occurs when a container that uses a vePFS PV is created for the first time.
Creating through the console
Step 1: Create an SC
- In the left navigation pane, click Cluster. In the right part of the page, click the target cluster name to open the management page of this cluster.
- In the left navigation bar of the cluster management page, click Storage > PersistentVolume. Click Create PersistentVolume to configure a PV.
Step 2: Create a PVC
- In the left navigation bar of the cluster management page, click Storage > PersistentVolumeClaim. Click Create PersistentVolumeClaim to configure a PVC.
Step 3: Create an application and mount the PV
After the dynamic PV of the vePFS type is created, add the PV to a workload that will use the PV. Supported workloads include Deployment, StatefulSet, Job, CronJob, and DaemonSet.
You can add a PV to a workload when creating it or updating it. For details, see Workloads. warning
When a workload is being created, a dedicated container for mounting the vePFS client is started first on the node. The vePFS client will occupy the computing resources of the Kubernetes node where the container is located. By default, the client uses 4 CPUs and 4 GiB of memory. If node resources are insufficient, both the csi-vepfs client container and the pod will fail to start.
Creating through kubectl
Step 1: Configure connection authentication
Run the following commands in sequence to store the SSH connection authentication information of the vePFS management node in a Secret.
tip
The addresses, passwords, and hostnames in the following example are for demonstration purposes only. Replace them with actual configurations based on your business requirements.
tip
If you have created a PV of type vePFS via the console, VKE will synchronously create a Secret that stores the addresses and login credentials of the management nodes for the mount service. You can specify a custom Secret name by using the adminHostsSecretName parameter, or check whether the Secret exists in the cluster by running the kubectl get -n kube-system secrets | grep "^vepfs-secret-mount-[0-9a-z]*" command.
Step 2: Create a StorageClass
- Create a YAML file for the SC. The following vke-pfs-sc.yaml file serves as an example:
- The key parameters are described in the following table.
- Run the following command to create the StorageClass.
Step 3: Create a PVC
- Create a YAML file for the PVC. The following vke-pfs-pvc.yaml file serves as an example:
- The key parameters are described in the following table.
- Run the following command to create the PVC.
Step 4: Create an application and mount the PV
- Create a YAML file for the Deployment. The following deployment-nginx-dynamic.yaml file serves as an example:
- Run the following command to create the Deployment.
warning
When a workload is being created, a dedicated container for mounting the vePFS client is started first on the node. The vePFS client will occupy the computing resources of the Kubernetes node where the container is located. By default, the client uses 4 CPUs and 4 GiB of memory. If node resources are insufficient, both the csi-vepfs client container and the pod will fail to start.
After creating a workload and mounting a PV to it as described in the preceding steps, you can verify the volume mounting status and persistent storage via the following methods.
- Run the following command to check whether the PV dynamically provisioned based on the PVC has been created and bound to the PVC.
- The expected result is as follows:
- Run the following command to check whether the PV is mounted to the specified path in the pod.
- The expected response is as follows.
- Check the mount path in the pod to view the data in the PV.
- The expected response is as follows.
- Check the mount path of the PV in the newly created pod.
- The expected result is as follows. You can see that the file written to the PV still exists and is not deleted along with the pod. This indicates that persistent storage of data is achieved.