Skip to main content
Version: 26.1

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.

  1. 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 FlashBlade
    note
    • The storage size in the PVC spec must match the size of the existing file system on FlashBlade.
    • The storageClassName must reference a StorageClass with backend: "pure_file".
    • For a complete list of all available PVC fields and annotations, see PersistentVolumeClaim reference.
    important

    If a file system with the same name exists on multiple FlashBlades and you don't specify the portworx.io/pure-array-id annotation, PX-CSI may import the file system from any of those arrays. To ensure you import from the correct array, always specify the portworx.io/pure-array-id annotation when multiple FlashBlades are connected to your cluster.

    Save this YAML in a file named preprovisioned-fb-pvc.yaml.

  2. Apply the YAML to your cluster:

    kubectl apply -f preprovisioned-fb-pvc.yaml
    persistentvolumeclaim/preprovisioned-fb-pvc created
  3. Verify the PVC is bound:

    kubectl get pvc preprovisioned-fb-pvc
    NAME                     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.

  1. 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: 80

    Save this YAML in a file named pod.yaml.

  2. Apply the YAML to your cluster:

    kubectl apply -f pod.yaml
    pod/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.