(kubectl) Automatically Creating an SFS Volume
Scenario
CCE supports creating SFS volumes through PersistentVolumeClaims (PVCs).
Prerequisites
You have created a CCE cluster and installed the CSI plug-in (everest) in the cluster.
Notes and Constraints
The following configuration example applies to clusters of Kubernetes 1.15 or later.
Procedure
SFS file systems have been sold out and cannot be automatically created.
- Use kubectl to connect to the cluster. For details, see Connecting to a Cluster Using kubectl.
- Run the following commands to configure the pvc-sfs-auto-example.yaml file, which is used to create a PVC.
touch pvc-sfs-auto-example.yaml
vi pvc-sfs-auto-example.yaml
Example YAML file:apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-sfs-auto-example namespace: default spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi storageClassName: csi-nasTable 1 Key parameters Parameter
Description
storageClassName
Name of the Kubernetes storage class. Set this field to csi-nas.
name
Name of the PVC to be created.
accessModes
Only ReadWriteMany is supported. ReadWriteOnly is not supported.
storage
Storage capacity in the unit of Gi.
- Run the following command to create a PVC.
kubectl create -f pvc-sfs-auto-example.yaml
After the command is executed, a file system is created in the VPC to which the cluster belongs. Choose Storage > SFS on the CCE console or switch to the SFS console to view the file system.
Last Article: Using SFS Volumes
Next Article: (kubectl) Creating a PV from an Existing SFS File System
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.