To enable automatic provisioning of Persistent Storage for our deployments, I use the NFS Storage Provisioner method, there are many others like Rook.io, OpenEBS, Minio etc, but this one works well for my home lab environment. I'll update the README in the future with detailed instructions on using other methods.
On ALL worker nodes
Add the nfs-common package if required.
sudo apt update && sudo apt install -y nfs-common
master01
kubectl create -f nfs-client/deploy/rbac.yaml
kubectl create -f nfs-client/deploy/deployment.yaml
kubectl create -f nfs-client/deploy/class.yaml
You can set the NFS Storage Provisioner as the default storage class which will make things a bit simpler.
kubectl patch deployment nfs-client-provisioner -p '{"spec":{"template":{"spec":{"serviceAccount":"nfs-client-provisioner"}}}}'
kubectl patch storageclass managed-nfs-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'