There is a minimum capacity limit when you create an SFS Turbo volume, so you are billed based on this minimum capacity rather than the capacity you have used. By default, when you mount an SFS Turbo volume to a workload, the root directory of the volume is mapped to the containers. The actual capacity used by the workload is far lower than the limit, leading to resource wastage.
The CCE Container Storage (Everest) add-on allows you to dynamically create subdirectories in an SFS Turbo file system and mount these subdirectories to containers. In this way, an SFS Turbo file system can be shared by multiple containers to increase storage efficiency.
Deleting the subPath volume does not result in the deletion of the SFS Turbo file system.
The following is an example:
apiVersion: storage.k8s.io/v1allowVolumeExpansion: truekind: StorageClassmetadata:name: sfsturbo-subpath-sc # Storage class namemountOptions: #Mount options- lockparameters:csi.storage.k8s.io/csi-driver-name: sfsturbo.csi.everest.iocsi.storage.k8s.io/fstype: nfseverest.io/archive-on-delete: "true"everest.io/share-expand-type: bandwidtheverest.io/share-export-location: 192.168.1.1:/sfsturbo/ # Mount directory configurationeverest.io/share-source: sfs-turboeverest.io/share-volume-type: STANDARDeverest.io/volume-as: subpatheverest.io/volume-id: 0d773f2e-1234-1234-1234-de6a35074696 # ID of an SFS Turbo volumeprovisioner: everest-csi-provisionerreclaimPolicy: DeletevolumeBindingMode: Immediate
Where:
mountOptions:- vers=3- timeo=600- nolock- hard
The following is an example:
apiVersion: v1kind: PersistentVolumeClaimmetadata:name: sfs-turbo-test # PVC namenamespace: defaultspec:accessModes:- ReadWriteManyresources:requests:storage: 50GistorageClassName: sfsturbo-subpath-sc # Storage class namevolumeMode: Filesystem
Where:
The capacity of a subPath volume is restricted by the overall resource capacity of the corresponding SFS Turbo file system. If the resources of the SFS Turbo file system are inadequate, you can adjust the resource capacity via the SFS Turbo console.
The following is an example:
Where:
kubectl create -f deployment-test.yaml
The following is an example:
apiVersion: apps/v1kind: StatefulSetmetadata:name: test-turbo-subpath # Name of the created workloadnamespace: defaultgeneration: 1labels:appgroup: ''spec:replicas: 2selector:matchLabels:app: test-turbo-subpathtemplate:metadata:labels:app: test-turbo-subpathannotations:metrics.alpha.kubernetes.io/custom-endpoints: '[{"api":"","path":"","port":"","names":""}]'pod.alpha.kubernetes.io/initialized: 'true'spec:containers:- name: container-0image: 'nginx:latest' # Image of a workloadresources: {}volumeMounts:- name: sfs-turbo-160024548582479676mountPath: /tmp # Mount path in a containerterminationMessagePath: /dev/termination-logterminationMessagePolicy: FileimagePullPolicy: IfNotPresentrestartPolicy: AlwaysterminationGracePeriodSeconds: 30dnsPolicy: ClusterFirstsecurityContext: {}imagePullSecrets:- name: default-secretaffinity: {}schedulerName: default-schedulervolumeClaimTemplates:- metadata:name: sfs-turbo-160024548582479676namespace: defaultannotations: {}spec:accessModes:- ReadWriteManyresources:requests:storage: 10GistorageClassName: sfsturbo-subpath-sc # Enter the name of a self-managed storage class.serviceName: wwwwpodManagementPolicy: OrderedReadyupdateStrategy:type: RollingUpdaterevisionHistoryLimit: 10
Where:
kubectl create -f statefulset-test.yaml