Static Provisioning of FlashArray Block Volumes
Use PX-CSI to import existing FlashArray block volumes into Kubernetes. This page walks you through creating a PVC with annotations to import an existing volume and mounting it to a pod.
PX-CSI also supports importing volumes from FlashArray ActiveCluster. For more information, see Use FlashArray ActiveCluster for high availability.
Use this approach when volumes are pre-created on FlashArray and you want to consume them as PersistentVolumeClaims (PVCs) in your Kubernetes cluster.
PX-CSI manages all imported FlashArray block volumes and tags them for identification. Each imported volume receives a created-by: px-csi tag in the portworx.internal namespace.
Prerequisites
Before you begin, ensure you have:
- An existing volume on FlashArray.
- The volume 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 block volume, create a PVC with the required annotations.
-
Create a PVC that references the existing FlashArray volume using the following annotations:
portworx.io/pure-volume-name(required): Use the format<realm>::<pod_name>::<volume_name>. Therealmandpod_nameare optional and only required if your volume exists within a specific realm and pod.- (Optional)
portworx.io/pure-array-id: Specify the FlashArray ID to indicate which array to import the volume from when multiple FlashArrays are connected to your cluster.
Example PVC specification:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: preprovisioned-fa-pvc
annotations:
portworx.io/pure-volume-name: "<existing-volume-name>" # Format: <realm>::<pod_name>::<volume_name> if you are using realm and pod. For ActiveCluster setup, specify the stretched pod name.
# portworx.io/pure-array-id: "<your-flasharray-id>" # Optional: specify array ID if you want to import the volume from specific array
spec:
storageClassName: px-fa-direct-access
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi # Must match the size of the existing volume on FlashArraynote- The
storagesize in the PVC spec must match the size of the existing volume on FlashArray. - The
storageClassNamemust reference a StorageClass withbackend: "pure_block". - For a complete list of all available PVC fields and annotations, see PersistentVolumeClaim reference.
importantIf a volume with the same name exists on multiple FlashArrays and you don't specify the
portworx.io/pure-array-idannotation, PX-CSI may import the volume from any of those arrays. To ensure you import from the correct array, always specify theportworx.io/pure-array-idannotation when multiple FlashArrays are connected to your cluster.Save this YAML in a file named
preprovisioned-pvc.yaml. -
Apply the YAML to your cluster:
kubectl apply -f preprovisioned-pvc.yamlpersistentvolumeclaim/preprovisioned-fa-pvc created -
Verify the PVC is bound:
kubectl get pvc preprovisioned-fa-pvcNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
preprovisioned-fa-pvc Bound pvc-abc123... 100Gi RWO 10s
Mount a PVC to a pod
To make the volume available to your workload, create a pod and attach the PVC using a volume mount.
-
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-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.