The .yaml file is actually a values file for the Helm chart democratic-csi/democratic-csi
- Make sure TrueNAS has a dataset
nvme2tb/k8s
(or update the yaml file) - If you're using iSCSI, do the following in TrueNAS:
- Create a dataset
nvme2tb/k8s/iscsi
- Make sure Block (iSCSI) Shares Targets is running, and click Configure
- Save the defaults for Target Global Configuration
- Add a portal on 0.0.0.0:3260
- Add an Initiator Group, Allow all initiators, and name it something like k8s-talos
- Create a Target named
donotdelete
and aliasdonotdelete
, then add iSCSI group selecting the Portal and Initiator Group you just created. This prevents TrueNAS from deleting the Initiator Group if you're testing and you delete the one and only PV. - Make note of the portal ID and the Initiator Group ID and update these values in the file
freenas-api-iscsi.yaml
if needed - During testing, the manually created Initiator Group was getting deleted whenever deleting the last PV. This appears to be a bug in TrueNAS somewhere according to democratic-csi/democratic-csi#412. Essentially TrueNAS deletes the Initiator Group automatically if an associated Target is deleted and no others exist. If you followed the instructions and created a manual Target this won't be an issue :)
- Create a dataset
- Make sure TrueNAS has an API key that matches what's in the yaml file
- If not, add one in TrueNAS in the top right corner go to Admin > API Keys
- Create the democratic-csi namespace:
kubectl create ns democratic-csi
- Make that namespace privileged:
kubectl label --overwrite namespace democratic-csi pod-security.kubernetes.io/enforce=privileged
- Deploy the helm chart for each type of storage class you want:
helm upgrade --install --namespace democratic-csi --values freenas-api-nfs.yaml truenas-nfs democratic-csi/democratic-csi
helm upgrade --install --namespace democratic-csi --values freenas-api-iscsi.yaml truenas-iscsi democratic-csi/democratic-csi
- (WIP, this works up until attempting to attach a pod to the PVC and I can't get support on it)
helm upgrade --install --namespace democratic-csi --values zfs-generic-nvmeof.yaml truenas-nvmeof democratic-csi/democratic-csi
- Check that the pods are running on each worker node:
kubectl get po -n democratic-csi
- If not, check why:
kubectl describe pod [pod-name] -n democratic-csi
- If not, check why:
- Deploy the test pvc and wait a minute to verify it was provisioned
- Check with
kubectl get pv
- If it's not working, check
kubectl describe pvc testpvc