Skip to main content
Version: 26.1

Static Provisioning of FlashArray File Services

Use PX-CSI to import existing FlashArray File Services file systems into Kubernetes. 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 FlashArray File Services and you want to consume them as PersistentVolumeClaims (PVCs) in your Kubernetes cluster.

Prerequisites

Before you begin, ensure you have:

  • An existing file system, directory, and export on FlashArray File Services.
  • The file system name (and optionally, the array ID if you have multiple FlashArrays connected to your cluster).
  • PX-CSI version 26.1.0 or later.

Create a PVC

To import an existing FlashArray File Services file system, create a PVC with the required annotations.

  1. Create a PVC that references the existing FlashArray File Services file system using the following annotations:

    • portworx.io/pure-volume-name (required): The name of the existing file system. Format: pod_name::filesystem_name. The pod_name is optional and only required if your file system exists within a specific pod. Otherwise, use only filesystem_name.
    • (Optional) portworx.io/pure-array-id: Specify the FlashArray ID to indicate which array to import the file system from when multiple FlashArrays are connected to your cluster.

    Example PVC specification:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: preprovisioned-fa-files-pvc
    annotations:
    portworx.io/pure-volume-name: "<existing-filesystem-name>" # Format: <pod_name>::<filesystem_name> (pod_name is optional)
    # portworx.io/pure-array-id: "<your-flasharray-id>" # Optional: specify array ID you want to import the volume from specific array
    spec:
    storageClassName: px-fa-file-direct-access
    accessModes:
    - ReadWriteMany
    resources:
    requests:
    storage: 500Gi # Must match the size of the existing file system
    note
    • The storage value in the PVC spec must match the size of the existing file system.
    • The storageClassName must reference a StorageClass with backend: "pure_fa_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 FlashArrays 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 FlashArrays are connected to your cluster.

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

  2. Apply the YAML to your cluster:

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

    kubectl get pvc preprovisioned-fa-files-pvc
    NAME                          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    preprovisioned-fa-files-pvc Bound pvc-xyz789... 500Gi RWX 15s

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-fa-files-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.