Static Provisioning of FlashBlade File Systems
Use PX-CSI to import existing FlashBlade file systems into Kubernetes without creating new file systems. This page walks you through creating a PVC with annotations to import an existing file system and mounting it to a pod or deployment.
Use this approach when file systems are pre-created on FlashBlade and you want to consume them as PersistentVolumeClaims (PVCs) in your Kubernetes cluster.
Prerequisites
Before you begin, ensure you have:
- An existing file system on FlashBlade.
- The file system name (and optionally, the array ID if you have multiple FlashBlades connected to your cluster).
- PX-CSI version 26.1.0 or later.
Create a PVC
To import an existing FlashBlade file system, create a PVC with the required annotations.
-
Create a PVC that references the existing FlashBlade file system using the following annotations:
portworx.io/pure-volume-name(required): The name of the existing file system on FlashBlade.- (Optional)
portworx.io/pure-array-id: Specify the FlashBlade array ID to indicate which array to import the file system from when multiple FlashBlades are connected to your cluster.
Example PVC specification:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: preprovisioned-fb-pvc
annotations:
portworx.io/pure-volume-name: "<existing-filesystem-name>"
# portworx.io/pure-array-id: "<your-flashblade-id>" # Optional: specify array ID if you want to import the volume from specific array
spec:
storageClassName: px-fb-direct-access-nfsv3
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Ti # Must match the size of the existing file system on FlashBladenote- The
storagesize in the PVC spec must match the size of the existing file system on FlashBlade. - The
storageClassNamemust reference a StorageClass withbackend: "pure_file". - For a complete list of all available PVC fields and annotations, see PersistentVolumeClaim reference.
importantIf a file system with the same name exists on multiple FlashBlades and you don't specify the
portworx.io/pure-array-idannotation, PX-CSI may import the file system from any of those arrays. To ensure you import from the correct array, always specify theportworx.io/pure-array-idannotation when multiple FlashBlades are connected to your cluster.Save this YAML in a file named
preprovisioned-fb-pvc.yaml. -
Apply the YAML to your cluster:
kubectl apply -f preprovisioned-fb-pvc.yamlpersistentvolumeclaim/preprovisioned-fb-pvc created -
Verify the PVC is bound:
kubectl get pvc preprovisioned-fb-pvcNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
preprovisioned-fb-pvc Bound pvc-def456... 1Ti RWX 12s
Mount a PVC to a pod
To mount the file system to a pod, create a pod that uses the PVC.
-
Create a pod specification that references the PVC:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
spec:
volumes:
- name: pure-vol
persistentVolumeClaim:
claimName: preprovisioned-fb-pvc
containers:
- name: nginx
image: nginx
volumeMounts:
- name: pure-vol
mountPath: /data
ports:
- containerPort: 80Save this YAML in a file named
pod.yaml. -
Apply the YAML to your cluster:
kubectl apply -f pod.yamlpod/nginx-pod created
Verify pod status
After deploying the pod, check its status to confirm that the volume is bound and attached successfully.
watch kubectl get pods
Wait for the STATUS column to show Running. Once the pod is running, the volume is mounted and ready for use.