Hi,
I've installed NFS and NFS CSI with the help of this https://microk8s.io/docs/how-to-nfs
Works fine. Then I've installed K10 and wanted to make snapshots.
But it refused to work.
I found externalSnapshotter in helm chart values so i enabled it. I also created VolumeSnapshotClass.
Do i have to install https://github.com/kubernetes-csi/external-snapshotter ? That tutorial seems to me very complex so i'm not exactly sure what to do.
I don't understand it at all.
Latest error from k10 is
cause: '{"cause":{"cause":{"cause":{"cause":{"message":"Failed to create snapshot: failed to take snapshot of the volume 10.0.0.6#nfsserver/pv#pvc-c5cec9f6-1555-442c-bd66-c984cad71d16##: \"rpc error: code = Internal desc = failed to create archive for snapshot: exit status 1:
@mscrocdile This looks really interesting. I have not played around with an external snapshotter like this before. However, definitely going to put on my list of things to try. @t3hbeowulf any insights with this or the error?
That is interesting. I haven't used external-snapshotter yet either but based on a first glance, I think you will need to install it to get that to feature to work. The directive in K10 is likely expecting external-snapshotter to be there and configured when it is called.
Do the container logs for K10 or cluster events reveal anything interesting?
I'll have to give this a try when I get home. Maybe external-snapshotter just needs a more succinct "getting started" guide.
Hi @mscrocdile
The csi-driver-nfs project / chart contains everything you need to create snapshots.
I have the project installed on k3s via the manifests rather than the helm chart, but the helm chart should be fine as per the microk8s tutorial. I had never tried the snapshot feature and just now I followed this example tutorial. It worked fine and I was left with this on my NFS server:
pvc-b82e7bc7-c10a-424a-ba75-156a4ba317d6/outfile snapshot-5d3b1d3d-eda7-4490-8da8-8d2d866f1833/pvc-b82e7bc7-c10a-424a-ba75-156a4ba317d6.tar.gz
Make sure you're checking your NFS server logs for permission errors. Also check to see if the PVC directory was actually created on your NFS server before snapshotting it.
Since you're running on microk8s, make sure that you have the kubeletDir set correctly in your values file:
kubeletDir: /var/snap/microk8s/common/var/lib/kubelet
I just mention here another sub problem related to this.
In K10 if i restore snapshot into new namespace it works.
But if i delete namespace and restore from K10/Applications/Removed then i will always get error.
k logs csi-nfs-controller-d96ccb59c-b7cxx -n kube-system
I0223 07:49:22.750254 1 controller.go:1366] provision "rumburak-novy/data-my-postgresql-0" class "nfs-csi": started I0223 07:49:22.759026 1 event.go:364] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"rumburak-novy", Name:"data-my-postgresql-0", UID:"c36787bf-9cef-4c50-b199-5cd9b2aeb215", APIVersion:"v1", ResourceVersion:"6262566", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "rumburak-novy/data-my-postgresql-0" W0223 07:49:22.775566 1 controller.go:1202] requested volume size 8589934592 is greater than the size 0 for the source snapshot k10-csi-snap-xvsqjrc55fx6qmdt. Volume plugin needs to handle volume expansion. I0223 07:49:23.015094 1 controller.go:1075] Final error received, removing PVC c36787bf-9cef-4c50-b199-5cd9b2aeb215 from claims in progress W0223 07:49:23.017682 1 controller.go:934] Retrying syncing claim "c36787bf-9cef-4c50-b199-5cd9b2aeb215", failure 6 E0223 07:49:23.017769 1 controller.go:957] error syncing claim "c36787bf-9cef-4c50-b199-5cd9b2aeb215": failed to provision volume with StorageClass "nfs-csi": rpc error: code = Internal desc = failed to copy volume for snapshot: exit status 2: tar (child): /tmp/snapshot-29e6025c-b9f0-431a-8b82-76814cf3ccb5/snapshot-29e6025c-b9f0-431a-8b82-76814cf3ccb5/pvc-f2967ba0-5664-4342-bab2-fbd3243e5011.tar.gz: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now I0223 07:49:23.015448 1 event.go:364] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"rumburak-novy", Name:"data-my-postgresql-0", UID:"c36787bf-9cef-4c50-b199-5cd9b2aeb215", APIVersion:"v1", ResourceVersion:"6262566", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "nfs-csi": rpc error: code = Internal desc = failed to copy volume for snapshot: exit status 2: tar (child): /tmp/snapshot-29e6025c-b9f0-431a-8b82-76814cf3ccb5/snapshot-29e6025c-b9f0-431a-8b82-76814cf3ccb5/pvc-f2967ba0-5664-4342-bab2-fbd3243e5011.tar.gz: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now
If i find something i will put it here.