Create a Distributed File Storage Volume
Deploy a Distributed File Storage volume using PVCs on CKS
Distributed File Volumes are deployed as Persistent Volumes using Persistent Volume Claims (PVCs). To create a Persistent Volume for a Distributed File Storage volume, set the accessMode
for the PVC as ReadWriteMany
, and the storage class as shared-vast
, as highlighted in the manifest below.
Here is an example of a PVC manifest for deploying a Distributed File Storage volume:
apiVersion: v1kind: PersistentVolumeClaimmetadata:name: new-pvcnamespace: defaultspec:accessModes:- ReadWriteManyresources:requests:storage: 1GistorageClassName: shared-vast
Once the manifest is created and configured as desired, apply it using kubectl
. For example:
$kubectl apply -f sample-shared-fs.yaml
Attaching Storage Volumes
Customers must create and provision storage volumes before they can be attached to a Pod.
Attach to Pods
To attach a Distributed File volume to a Pod, specify the mountPath
and name
under the volumeMounts
stanza. Then, specify the volumes.name
and the persistentVolumeClaim.claimName
as shown in the following example:
apiVersion: v1kind: Podmetadata:name: filesystem-storage-examplespec:containers:- image: nginx:1.14.2name: nginxvolumeMounts:- mountPath: /storagename: filesystem-storagevolumes:- name: filesystem-storagepersistentVolumeClaim:claimName: filesystem-storage-pvc
Expanding Volumes
Deployed Distributed Filesystem Volumes can be expanded without disrupting running workloads.
Shrinking volumes is not supported - volumes cannot be downsized after they are expanded.
To expand a volume, use kubectl patch
to patch the existing volume manifest. For example, to expand a volume to 500Gi, run:
$kubectl patch pvc my-volume -p \'{"spec":{"resources":{"requests":{"storage": "500Gi"}}}}'