Dynamic Provisioning of FlashArray File Services
Use PX-CSI to dynamically provision file-based volumes using FlashArray file services. This page walks you through creating a StorageClass, provisioning a PersistentVolumeClaim (PVC), and mounting it to a pod.
Create a StorageClass
To enable dynamic provisioning on FlashArray file services, define a StorageClass with the appropriate backend and NFS configuration.
For FlashArray file services, set the backend type to "pure_fa_file". You can also configure parameters like quota policy, mount options, and topology settings.
-
Ensure that you have configured FlashArray to use file services. For more information, see Configure FlashArray file services
-
If you configure an NFS policy with
root_squashand your pod specifies anfsGroup, you might see permission errors (for example,permission deniedorlchown failed) during volume mount because the root user is mapped tonfsnobody. To avoid this:- Ensure that the NFS policy uses
no_root_squashaccess. - Ensure that the User Mapping Enabled field is set to Disabled when creating the NFS policy.
For more information, see Configure FlashArray File Services.
- Ensure that the NFS policy uses
-
Define a
StorageClasswith the appropriate storage type and performance settings. For FlashArray file systems, use the backend typepure_fa_file.Required parameters:
backend: "pure_fa_file"- Specifies that the volume is an FA file volume.pure_nfs_policy- PX-CSI expects that the NFS policy is pre-created on FA setups. If the policy does not exist, the request will fail.pure_fa_file_system- Specifies the file system where the volume needs to be placed. If the file system does not exist in the FlashArray setup, the volume create request fails.
Optional parameters:
pure_quota_policy- If provided, associates the volume with a fixed quota policy and overrides automatic per-PVC size enforcement (PX-CSI 26.3.0 and later). For more information, see Configure FA File PVC Size Enforcement.pure_nfs_endpoint- Used when there are multiple endpoints per array. Overrides the defaultNFSEndPointspecified inpure.json.pure_nfs_server- Name of the NFS server on the FlashArray where the directory is exported. This is the server object name, not an IP address. Use withpure_nfs_policy. Requires PX-CSI version 26.3.0 or later, and Purity version 6.8.7 or later.allowedTopologies- Uses topology labels to select arrays with matching labels for volume placement.volumeBindingMode: If you have enabled CSI topology, ensure you specify thevolumeBindingMode: WaitForFirstConsumerparameter along withallowedTopologies. ThevolumeBindingMode: WaitForFirstConsumerdelays volume binding until the Kubernetes scheduler selects a suitable node that matches theallowedTopologieslabels.mountOptions- Overrides default mount options. If not specified, PX-CSI usesnfsvers=4.1as the default.- If the NFS policy on FlashArray specifies a version, that takes precedence. Supports only TCP, not UDP. You can also specify multiple security options using the
mountOptions.secfield. - By default, NFS uses
sec=auth_sys, but support is also available for Kerberos-based authentication options, includingsec=krb5(authentication only),sec=krb5i(authentication and integrity), andsec=krb5p(authentication, integrity, and encryption). - To enable NFS over TLS, add
xprtsec=tlstomountOptions. This requires Purity version 6.10.6 or later, and worker nodes must havenfs-utils,ktls-util(tlshd), andopensslinstalled.
- If the NFS policy on FlashArray specifies a version, that takes precedence. Supports only TCP, not UDP. You can also specify multiple security options using the
importantStarting from PX-CSI version 26.3.0, PX-CSI automatically enforces PVC size limits for FlashArray file services using per-PVC quota policies. If you do not specify
pure_quota_policy, PX-CSI creates and attaches a quota policy automatically. To disable this behavior or use a fixed quota policy, see Configure FA File PVC Size Enforcement.Example
StorageClassYAML:- IPv4
- IPv6
kind: StorageClassapiVersion: storage.k8s.io/v1metadata:name: fa-file-scprovisioner: pxd.portworx.comparameters:backend: "pure_fa_file"pure_nfs_policy: "test-policy"pure_fa_file_system: "name01"pure_quota_policy: "100g_policy"pure_nfs_endpoint: <nfs-endpoints-of-fa># pure_nfs_server: "<nfs-server-name>" # optional: specify a server other than the default _array_server (Requires PX-CSI version 26.3.0 or later, and Purity version 6.8.7 or later)mountOptions:- nfsvers=3- proto=tcp# - xprtsec=tls # optional: enable NFS over TLSvolumeBindingMode: WaitForFirstConsumerallowedTopologies:- matchLabelExpressions:- key: topology.portworx.io/zonevalues:- <zone-1>- key: topology.portworx.io/regionvalues:- <region-1>kind: StorageClassapiVersion: storage.k8s.io/v1metadata:name: fa-file-scprovisioner: pxd.portworx.comparameters:backend: "pure_fa_file"pure_nfs_policy: "test-policy"pure_fa_file_system: "name01"pure_quota_policy: "100g_policy"pure_nfs_endpoint: <nfs-endpoints-of-fa># pure_nfs_server: "<nfs-server-name>" # optional: specify a server other than the default _array_server (Requires PX-CSI version 26.3.0 or later, and Purity version 6.8.7 or later)mountOptions:- nfsvers=4.1- proto=tcp6# - xprtsec=tls # optional: enable NFS over TLSvolumeBindingMode: WaitForFirstConsumerallowedTopologies:- matchLabelExpressions:- key: topology.portworx.io/zonevalues:- <zone-1>- key: topology.portworx.io/regionvalues:- <region-1>tipFor a complete list of StorageClass parameters, see the StorageClass reference.
-
Apply this YAML to your cluster:
kubectl apply -f sc.yamlstorageclass.storage.k8s.io/fa-file-sc created
Create a PVC
Define a PersistentVolumeClaim (PVC) that references the fa-file-sc StorageClass.
-
To create a PVC, define the specifications and reference the StorageClass you previously created by specifying its name in the
spec.storageClassNamefield.Example PVC specification:
kind: PersistentVolumeClaimapiVersion: v1metadata:name: pure-claim-falabels:app: nginxspec:accessModes:- ReadWriteManyresources:requests:storage: 20GistorageClassName: fa-file-sctipFor a complete list of PersistentVolumeClaim fields and annotations, see the PersistentVolumeClaim reference.
Save this YAML in a file
pvc.yaml. -
Apply this YAML to your cluster:
kubectl apply -f pvc.yamlpersistentvolumeclaim/pure-claim-fa created
Mount a PVC to a pod
Attach the PVC to a pod by referencing it in the volumes section and mounting it inside the container:
-
Create a Pod and specify the PVC name in the
persistentVolumeClaim.claimNamefield. Here is an example pod specification:kind: PodapiVersion: v1metadata:name: nginx-podlabels:app: nginxspec:volumes:- name: pure-volpersistentVolumeClaim:claimName: pure-claim-facontainers:- name: nginximage: nginxvolumeMounts:- name: pure-volmountPath: /dataports:- containerPort: 80 -
(Optional) To control pod scheduling based on node labels, add the
nodeAffinityfield to the Pod specification. For example:spec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: topology.portworx.io/zoneoperator: Invalues:- zone-0- key: topology.portworx.io/regionoperator: Invalues:- region-0
Verify pod status
Check pod readiness and confirm the volume is mounted:
watch kubectl get pods
When the pod status shows Running, it is actively using the provisioned FlashArray file volume.