https://rancher.com/ logo
f

flaky-winter-94949

03/23/2023, 1:35 AM
Nfs support for container mounting is built into k8s now, no need for an external provisioner
r

refined-analyst-8898

03/23/2023, 1:46 AM
So there's an in-tree NFS provisioner? Would I still need to define a storage class that calls upon the provisioner? I didn't find any clues about what you mentioned over here in https://kubernetes.io/docs/concepts/storage/storage-classes/#nfs.
f

flaky-winter-94949

03/23/2023, 1:49 AM
Sorry, yes you just mount the nfs server volume directly into the container, youll need ‘nfs-common’ installed on any worker nodes that will be connecting out to the nfs server
If you meant you want to spin up an nfs server, thats been dead and buried as far as support and is now a security nightmare
r

refined-analyst-8898

03/23/2023, 1:52 AM
I'm not in any hurry to use NFS again either! It is sometimes unavoidable so I'm trying to catch up about the thing that's built in to K8s now. It sounds like it an admin, node-level operation. I was wondering if it was something I could use with a PVC as a pod deployer that's not a cluster admin.
via storage class, I mean
f

flaky-winter-94949

03/23/2023, 1:55 AM
So what i would recommend, mount the nfs shares directly on the vms you want to use as storage brokers, then spin up longhorn and point its storage location to that mounted nfs share
That would give you nfs storage backing along w all its resiliancy features, plus a proper storage api to call to for pvc creation
It might seem weird to have two diff storage types next to eachother, but keep in mind we do stuff like that with nginx for example all the time
Nfs is still good as a storage protocol imo, it just lacks the api features of the newer stuff like ceph and longhorn
r

refined-analyst-8898

03/23/2023, 2:01 AM
Best of both worlds.
👍 1
w

wonderful-rain-13345

03/23/2023, 2:11 AM
same go for k3s?
f

flaky-winter-94949

03/23/2023, 2:11 AM
I mean, my home lab pi cluster uses k3s and longhorn just fine
s

sparse-fireman-14239

03/24/2023, 7:58 AM
@flaky-winter-94949 placing Longhorn volumes on NFS feels counterintuitive. Now your NFS backend needs to be VERY highly available otherwise you lose all your persistent volumes. For a proper HA NFS cluster you'd need three NFS servers, in which case you might as well (I think..) setup three additional K8s nodes with Longhorn and have them serve the volumes using the built-in NFS.
8 Views