This is a quick guide for adding Portworx CSI ( PX-CSI 26.1.0 ) on ANY k8s.
Based on https://docs.harvesterhci.io/v1.8/advanced/csidriver/.
Please also check out https://dzver.rfed.io for the last versions of all these components.
tl:dr - Add multipathd. Add PX CSI, that points to an FA.
If you are on an air gap please read the airgap.md file on collecting all the bits and transfering them.
On ALL nodes ensure multipathd and iscsi is there.
for Rocky
dnf install -y nfs-utils cryptsetup iscsi-initiator-utils device-mapper-multipath; systemctl enable --now iscsid;If you are missing those packages. fix it. lol
cat << EOF >> /etc/multipath.conf
devices {
device {
vendor "NVME"
product "Pure Storage FlashArray"
path_selector "queue-length 0"
path_grouping_policy group_by_prio
prio ana
failback immediate
fast_io_fail_tmo 10
user_friendly_names no
no_path_retry 0
features 0
dev_loss_tmo 60
}
device {
vendor "PURE"
product "FlashArray"
path_selector "service-time 0"
hardware_handler "1 alua"
path_grouping_policy group_by_prio
prio alua
failback immediate
path_checker tur
fast_io_fail_tmo 10
user_friendly_names no
no_path_retry 0
features 0
dev_loss_tmo 600
}
}
blacklist_exceptions {
property "(SCSI_IDENT_|ID_WWN)"
}
blacklist {
devnode "^pxd[0-9]*"
devnode "^pxd*"
device {
vendor "VMware"
product "Virtual disk"
}
device {
vendor "IET"
product "VIRTUAL-DISK"
}
}
EOFHere we are going to install the CSI. Note the API token for a "storage admin" user. Here are the docs : https://docs.portworx.com/portworx-enterprise/platform/kubernetes/flasharray/install/install-flasharray/install-flasharray-cd-da
# get latest version of PX-CSI
PX_CSI_VER=$(curl -sL https://dzver.rfed.io/json | jq -r .portworx)
# create namespace
kubectl create ns portworx
# create and add secret
cat << EOF > pure.json
{
"FlashArrays": [
{
"MgmtEndPoint": "192.168.1.11",
"APIToken": "934f95b6-6d1d-ee91-d210-6ed9bce13ad1",
"NFSEndPoint": "192.168.1.8"
}
]
}
EOF
kubectl create secret generic px-pure-secret -n portworx --from-file=pure.json=pure.json
# apply operator yaml
kubectl apply -f 'https://install.portworx.com/'$PX_CSI_VER'?comp=pxoperator&oem=px-csi&kbver=1.35.6&ns=portworx'
# add annotation of "portworx.io/health-check: "skip" " for running on a single node
# If you want nvme-tcp change the value: "NVMEOF-TCP"
# or FA NFS : https://docs.portworx.com/portworx-csi/provision-storage/dynamic-provisioning/flasharray-file-services
kubectl apply -n portworx -f - << EOF
kind: StorageCluster
apiVersion: core.libopenstorage.org/v1
metadata:
name: px-cluster
namespace: portworx
annotations:
portworx.io/misc-args: "--oem px-csi"
#portworx.io/health-check: "skip"
spec:
image: portworx/px-pure-csi-driver:$PX_CSI_VER
imagePullPolicy: IfNotPresent
csi:
enabled: true
monitoring:
telemetry:
enabled: false
prometheus:
enabled: false
exportMetrics: false
env:
- name: PURE_FLASHARRAY_SAN_TYPE
value: "ISCSI"
EOFkubectl apply -n portworx -f - << EOF
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: demopvc
spec:
storageClassName: px-fa-direct-access
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1234Mi
EOFSuccess.
from https://docs.portworx.com/portworx-csi/reference/storage-class#storageclass
kubectl apply -n portworx -f - << EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: px-fb-direct-access-nfsv4-hardquota
mountOptions:
- nfsvers=4.1
- tcp
allowVolumeExpansion: false
parameters:
backend: pure_file
pure_export_rules: '*(rw)'
provisioner: pxd.portworx.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
EOF
# or
kubectl apply -n portworx -f - << EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: px-fa-direct-access
allowVolumeExpansion: true
parameters:
backend: pure_block #pure_fa_file
provisioner: pxd.portworx.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
EOF