Portworx CSI Storage Class
To use a CSI base storage class with Portworx ensure that your installation was setup with CSI enabled, if your Portworx installation isn't running with CSI enabled view the Portworx document here to enable CSI.
Once Portworx is running you need to create a storage class with the fowling configuration, this can be applied via the Platform9 SaaS Management Plane using the Storage Class dashboards.
kindStorageClassapiVersionstorage.k8s.io/v1metadata nameportworx-csi-scprovisionerpxd.portworx.comparameters repl"1"Create Storage Class
Navigate to the Storage Class dashboard and click Add New Storage Class.

Next, enter the details for the storage class.

Finally, review the configuration, ensure it matches the example below including the replication parameter at the bottom of the YAML spec. Once the YAML is correct click Complete and Platform9 will create the storage class.
kindStorageClassapiVersionstorage.k8s.io/v1metadata nameportworx-csi-scprovisionerpxd.portworx.comparameters repl"1"Create a Test PVC
You can test the CSI based storage class by creating a PVC with the following YAML spec and applying it to your cluster. Copy the YAML to a file locally and use kubectl to add the PVC. Ensure the StorageClassName matches the storage class that you created above
kindPersistentVolumeClaimapiVersionv1metadata namepx-mysql-pvcspec storageClassNameportworx-csi-sc accessModesReadWriteOnce resources requests storage2GiCreate the PVC from the YAML file with the command below:
kubectl apply -f pvc-test-portworx.yamlpersistentvolumeclaim/px-mysql-pvc createdTo view the state of the PVC run
kubectl get pvc px-mysql-pvcNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGEpx-mysql-pvc Bound pvc-81fae0ac-fda5-43e3-a760-d93359079896 2Gi RWO portworx-csi-sc 8sUse Kubectl to apply the YAML spec below to create an example MySQL application to use the new PVC.
kubectl apply -f mysql-example.yamlapiVersionapps/v1kindDeploymentmetadata namemysqlspec selector matchLabels appmysql strategy rollingUpdate maxSurge1 maxUnavailable1 typeRollingUpdate replicas1 template metadata labels appmysql version"1" spec containersimagemysql5.6 namemysql envnameMYSQL_ROOT_PASSWORD valuepassword portscontainerPort3306 volumeMountsnamemysql-persistent-storage mountPath/var/lib/mysql volumesnamemysql-persistent-storage persistentVolumeClaim claimNamepx-mysql-pvcRun kubectl get all -n default command to view the running deployment.
kubectl get all -n defaultNAME READY STATUS RESTARTS AGEpod/mysql-67f5996b5f-jwctm 1/1 Running 0 3m53sNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEservice/kubernetes ClusterIP 10.21.0.1 <none> 443/TCP 98mNAME READY UP-TO-DATE AVAILABLE AGEdeployment.apps/mysql 1/1 1 1 3m53sNAME DESIRED CURRENT READY AGEreplicaset.apps/mysql-67f5996b5f 1 1 1 3m53s