New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All Persistant Volumes fail permanently after NAS reboot #232
Comments
Ah this is a tricky one and I'm glad you opened this. So there are a couple issues at play here:
The first can be remedied by deleting all the Essentially if the nas goes down and comes back up the iscsi sessions on the node (assuming they recover) go to read-only. The only way to remedy that (via k8s) is to just restart the pods as appropriate..and even then in some cases that may not be enough and would require forcing the workload to a new node. I'll do some research on possible ways to just go to the cli of the nodes directly and get them back into a rw state manually without any other intervention at the k8s layer. |
For the record deleting all democratic-csi pods and the pod using the PVC did not solve the issue. Would the NFS version have the same issue? I'm hesitant to use it for something like plex because of the hundreds of thousands of small files, but if it doesn't break on reboot it may be worth it. |
I haven't been able to find an iscsiadm command that will take a device that's become There is some generic k8s/csi work being done that would hopefully help correct thees situations automatically, but all the pieces haven't come together yet. To mitigate the issue you could tweak some things like this: https://wiki.archlinux.org/title/ISCSI/Boot#Make_the_iSCSI_daemon_resilient_to_network_problems Regarding nfs, it recovers from reboots of the nas much better yes, but indeed file-based storage has performance implications in certain scenarios vs block-based. |
I would definitely try that out and get you the information, but I'm completely clueless about |
Can you send me the output of the |
there were hundreds of lines, so I
|
Those mounts are currently non-writable/non-functional? |
Yeah, that's a dangerous situation (which is why when iscsi goes down the volumes go into ro mode). 2 nodes using the same block device simultaneously is not something you want happening. I would use something like |
Any tips on how to tell kured when to reboot as soon as a Iscsi mount becomes into read-only mode? |
That could be a not a great assumption either (there are legitimate cases for ro iscsi). I probably wouldn’t fully automate that but if I were to do so I would use your iac tool of choice to just touch the reboot-required file on all the nodes when it’s clear the storage system was rebooted. For example I have an ansible playbook that does only that…but I only run it manually when I know an outage has occurred. If you really wish to detect a read-only scsi connections however I would probably write up a little script to detect that and put it on a cron/systemd timer right in the nodes. |
Maybe not the answer you were hoping for, but the best solution I've found is to do a rolling reboot of all my kube nodes whenever I reboot my NAS. It's a pain, but it's also an opportunity for patching etc. |
@travisghansen It looks like Longhorn has chosen to support simply deleting the pods managed by a controller when it identifies that a volume is no longer available. Could this be something you would be willing to support in democratic csi? |
Interesting, something to consider for sure. I think this could be handled by the health service endpoint. I am hesitant to get into such a thing but think it merits some discussion for sure. |
Longhorn solution looks promising for my usecase, would appreciate it getting implemented, unfortunately I'm too intimidated by huge JS codebase to try to contribute anything. Instead, I wrote a small HTTP server that will delete all pods that mount PVCs with given storage class, given hardcoded bearer token in authorization header. I'm using startup script on TrueNAS side to trigger that whenever NAS turns on. If anyone wants to use it - here is server itself: https://github.com/eaglesemanation/k8s-csi-restarter Edit: This does not delete democratic-csi controller and node pods themselves, didn't think about that. Will add that functionality soon |
@eaglesemanation thanks for sharing! |
Whenever I reboot the OS on the NAS that hosts my ISCSI democratic-csi volumes, all containers that rely on those volumes fail consistently even after the NAS comes back online with the following error:
I have tried suspending all pods with
kubectl scale -n media deploy/plex --replicas 0
to try and ensure that nothing is using the volume during the reboot.Unfortunately I know almost nothing about ISCSI, so it's entirely possible this is 100% my fault. What is the proper process with ISCSI for rebooting either the NAS, or the nodes using PVs on the NAS to prevent this lockup? Is there an
iscsiadm
command I can use to remove this deadlock and let the new container access the PV?my democratic-csi config is:
and the driver config is:
Not sure what other info is important, but I'd be happy to provide anything else that might help troubleshoot the issue.
The text was updated successfully, but these errors were encountered: