Using an existing fileset for volume creation
You might want to use the existing fileset for creating persistent volume.
The following section describes the limitation for using existing fileset as a Kubernetes volume.
- The existing fileset to be used as a Kubernetes volume must exist in the file system specified in storage class and it must be linked.
- Quota must be enabled for the file system specified in the StorageClass.
- Creating PVC using a root fileset is not supported.
- StorageClass parameters uid, gid, inode-limit, fileset-type are not valid for this functionality and must not be specified in the StorageClass.
- Quota on the fileset must be equal or greater than storage requested in the PVC.
- If the pv-name is not specified in the PVC yaml then a random PV name is generated, and the IBM Storage Enabler for Containers tries to lookup the fileset with that random PV name. However, the random PV name most likely does not exist, and hence the PVC wont become available for use.
- If an existing fileset is used with the reclaimPolicy set to
retain, then deleting the PVC does not delete the PV. The PV remains in a released state. If the released PV is deleted manually, and then if you tried to create a PVC with the same fileset name, the process fails.
Use the following steps to create volume using an existing fileset:
- Create a new StorageClass, and set parameter isPreexisting to
true.
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: "<NAME>" labels: product: ibm-storage-enabler-for-containers # annotations: # storageclass.beta.kubernetes.io/is-default-class: "true" provisioner: "ubiquity/flex" parameters: backend: "spectrum-scale" filesystem: "<filesystem name>" type: "fileset" isPreexisting: "true" - Create a PVC using the StorageClass created in step 1, and set the
parameter pv-name to <name of existing
fileset>.
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: "<PVC name>" labels: product: ibm-storage-enabler-for-containers pv-name: "<name of existing fileset>" spec: storageClassName: <StorageClass Name> accessModes: -ReadWriteOnce #ReadWriteOnce and ReadWriteMany resources: requests: storage: <Number>Gi