-
Notifications
You must be signed in to change notification settings - Fork 96
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
Compatibility with Nomad #14
Comments
considering that Nomad supports standard CSI interfaces and claims that the Kubernetes CSI plugins work out of the box, I don't see any reason why it wouldn't work. The bigger question is how to configure the plugin to work as intended. |
Hi @ressu, thank you for the response. I agree that the varies documentation claims that synology-csi should work with Nomad, but I'm not sure if that is true or not. Have you heard of anyone successfully using synology-csi with Nomad? I'd love to learn from their experience. When I tried to deploy this synology-csi container into Nomad, I got the error:
As you can see that's pointing to a kubernetes-specific endpoint Line 23 in dc05a79
I am new to csi plugins so maybe I just need to learn more about them in order to properly configure synology-csi to work with Nomad. But from what I can tell it doesn't seem like it will work, what do you think? |
unfortunately I don't know how Nomad invokes the CSI daemons, which would give me a better idea on how to solve this. The path for the csi socket can be overridden with a flag Line 98 in dc05a79
many of the default features are mainly handled by the generic csi containers, so that would change the situation a bit too. That being said, if you can adjust the startup of the csi plugin and add |
Awesome, that's super helpful @ressu! I'll close this for now. If anyone else has advice on properly configuring this plugin to work with Nomad, please reach out :) |
Hey @ressu, another question for you. I was able to make some progress and get the synology-csi plugin running in Nomad by setting
It's unable to find the volume on our Synology DSM: |
I checked my logs and it seems that the
I think the DSM in context is also required so that the CSI knows which DSM to contact, but I'm not certain. Also, make sure that your volumes have an appropriate prefix as defined in synology-csi/pkg/models/dsm.go Lines 19 to 21 in dc05a79
|
Thanks @ressu. Apologies for my ignorance but how would I find the UUID of the LUN? |
Oh, right! It's not immediately visible. I think I found the UUID by inspecting the source code in the admin UI. I had to dig around there when I migrated my old volumes. The normal volume creation automation in Kubernetes will figure it automatically for the volumes created by the CSI. But for externally created volumes the pain of searching the HTML in admin console was real :( |
Oh boy that is a bit hacky. Ok I'll look around. Do you remember what part of the UI you were able to find it in? |
Yeah, It's very hacky. I preferred the third party CSI mechanism over this one, but you use what you can 😄 The way you can find the UUID of the volume is in SAN Manager. If you list the LUNs there and look at the source code, the The way I got it is in chrome using the inspector and I just created a breakpoint to the HTML element subtree modifications, which froze things for long enough to properly copy the UUID from the list. |
Awesome! I was able to find the UUID via the
The volume prefix - is that something I configure on the DSM side or the Nomad side? I don't see a prefix option in the LUN configuration: fwiw the |
The prefix goes into the LUN name. I think you also need to create an iSCSI host with the same prefix. Mine are in the form of |
The synology-csi only looks for LUNs with the prefix "k8s-csi". Try to change the LUN name from "LUN-1" to "k8s-csi-LUN-1". |
Sweet, thanks to both of you! synology-csi was able to successfully find the volume after using the UUID and creating a LUN and iSCSI host with the name
The Line 4 in dc05a79
|
fwiw I tried
|
The Relevant Kubernetes configurations are synology-csi/deploy/kubernetes/v1.19/node.yml Lines 112 to 113 in dc05a79
and synology-csi/deploy/kubernetes/v1.19/node.yml Lines 132 to 135 in dc05a79
I don't know how the containers are configured for Monad, but effectively you need to mount |
Ok makes sense, I need to make a Nomad client config change to make that root filesystem from the host available, so I will work on that and then try deploying the job again. My instinct makes me nervous to mount the entire host filesystem inside the container. Would you mind describing why is this needed? Thanks again @ressu for helping here! I'm hoping that all this information and troubleshooting will be useful to other folks who try to use synology-csi with Nomad. |
Trust me, you're not alone with this one. I wanted to work around the mount in other CSIs, but couldn't find a reliable way 😆 As far as I understand, the host mount allows the CSI to act as the host system while the container sandbox is in place. It's a cheap trick used quite often to reduce complexity of the code whenever there are too many dependencies to the host system. I've seen the same pattern being used in other CSIs and CNIs.
Happy to help, I'm mostly stabbing in the dark since I've never run Nomad myself. But I'm just happy that you are able to make progress with the hints I'm able to give you. |
I need to take a pause on this synology-csi <> Nomad work and will hopefully come back to it at a later date. For now I will close out this issue since all my open questions have been answered. I'll reopen this issue if/when I come back to it and new questions arise. If anyone finds this issue in the future and wants to know how my nomad job.hcl, volume.hcl, and related configuration ended up, please reach out. Thanks again for all the help! |
The creation of a storage does work, but there is still some problem with the access mode within nomad:
my current configuration for the nomad csi plugin job is like this
and the volume definition for the
|
Hi @mabunixda, I think I ran into a similar issue. I used the Interestingly, when I moved the
I didn't tried the |
@johnnyplaydrums yes the create actually creates a volume on my synology - but it does not get usable on nomad .. |
@mabunixda does putting |
no because that is not a valid syntax for nomad > 1.1.0 |
Ah I see |
Hello everyone, I am quite interested on this thread and will be hitting this wall soon (Have not setup nomad on this new setup), I hope we can make this work together at some point :) |
I started working on this also. I took a route of following the Stateful Workloads tutorial and copying what made sense from the synology-csi configs. My Fork, nomad stuff is in deploy/nomad/v1.2.5 I've been able to get a controller and node going. Both appear to be running, connect to DSM, and no errors showing in the docker logs. I can create volumes, and these show up in SAN Manager in DSM with what appear to be the correct settings. In Nomad they also show as Schedulable but Access Mode for all volumes is no matter what I use as the access_mode for creation. If I try to use one of these volumes as a mount, the run fails. I assume because the volume doesn't appear to have the same access and attachment as the job.
At this point I suspect there's a miscommunication between nomad and the csi plugin for grabbing capabilities of a volume, but I'm not sure how to test it. I have set log-level=debug for controller and node which does print a lot of data. Not sure how to get something similar on the nomad side. Debug level logging in nomad doesn't seem to show any of the actual communication with the plugin. |
This driver implements csi but does so with k8s-isms as you have discovered. I have a pure csi based driver that works with synology (and nomad) available here: https://github.com/democratic-csi/democratic-csi |
Necro'ing this thread since I'm also banging my wall against a wall getting synology-csi to work on Nomad + my Synology DS220+. I got Nomad running on my DS220+ with the latest DSM, but when I try to deploy the synology-csi I'm getting the following error messages in the systemd journal:
Nomad is running as root, therefore I think we can exclude permission issues. Any idea what might cause these issues? The first line with "bind: illegal argument" looks like the culprit to me. |
I was able to successfully get this working with Nomad 1.6.x using iSCSI. As stated above, the SMB portion relies on a k8s secret which Nomad cannot consume. Here is a working example of a csi-driver job, volume spec example, and an example job file consuming that volume for anyone who might need it. I'll submit a PR for docs at some point. One of the things that may seem obvious, but I can't find listed anywhere is the need for the following packages installed on the host running Nomad:
I have not tested what exactly is required or not required. I found it on a blog and just installed them all and it works. CSI Driver job - synology-csi.nomad.hclUsing monolith here. Not really a need to break it out for homelab use which I assume is what most people are using Synology's for. Run
Volume spec - example-volume.nomad.hclRun:
Validate its created and healthy by running Example App Job - synology-csi-example.nomad.hcl
Run |
@awanaut thank you for this information, im trying to set it up myself. Can you share some infonregarding the config on thr synology. Is it still required to create a lun with the k8s-csi prefix as mentioned above? |
Nope! You just need to make sure the volume is available under the "parameter" stanza. |
@awanaut Thanks a ton for figuring all this out. I was able to get it set up and working on my cluster. I ran into one minor issue that I'm wondering if others have seen. When mounting an iSCSI volume into a task, the mount point is owned by root (uid/gid=0), with permissions of 755. This causes some apps, such as postgres, to fail since they run as a non-root user and try to chown their data directory on startup. I got around this by creating a sidecar pre-start task that fixed the permissions on the volume before the main task runs, but I'm wondering if there's a better/cleaner way. I've experimented with a few settings without much luck. |
@s4v4g3 Might this be related to the func |
@awanaut, any suggestion on how to define the nomad job, I'm struggling to convert the Kubernetes spec to nomad for snapshots. |
Hello! I was wondering if synology-csi works with Nomad? At first glance it would appear there is only support for Kubernetes, but I just wanted to double check. Thank you
The text was updated successfully, but these errors were encountered: