CCE supports creating SFS volumes through PersistentVolumeClaims (PVCs).
You have created a CCE cluster and installed the FlexVolume plug-in (storage-driver) in the cluster.
The following configuration example applies to clusters of Kubernetes 1.13 or earlier.
touch pvc-sfs-auto-example.yaml
vi pvc-sfs-auto-example.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: nfs-rw
name: pvc-sfs-auto-example
namespace: default
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
Parameter |
Description |
|---|---|
volume.beta.kubernetes.io/storage-class |
File storage class. Currently, the standard file protocol type (nfs-rw) is supported. |
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. |
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 log in to the SFS console to view the file system.