-
Notifications
You must be signed in to change notification settings - Fork 82
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
Nomad Support #40
Comments
Interesting! Got a link to their approach I can read over? I adhered very strictly to the spec and purposely left out any k8s-isms in the code base so I’m guessing this should be doable yes. Will nomad invoke the |
Nomad has a page that has some of the details of the way it handles CSI plugins. Additionally, this comment has the details of what Nomad implements. While this plugin implements the spec properly, Nomad currently has not implemented the parts that talk to the controller, and is why the volumes have to be manually created. At the moment, the best way to provide Nomad support is probably a Terraform plugin that can create a CSI volume, as Terraform can then handle registering the volume with Nomad automatically. However, this seems like something that is understandably out of scope of this project. I have working Nomad job files to deploy the plugin and am happy to clean them up and provide them as part of the documentation. |
Got it! Let me read a bit more thoroughly. Does your deployment setup currently deploy the controller as well (it looks like they do support/use/invoke the publish/unpublish bits but seemingly not create). If you do deploy the controller it’s hypothetically possible to expose the controller via grpc over tcp instead of unix socket (or rather, in addition to). At that point you could invoke the create methods with terraform or whatever to handle that aspect (you would want to secure that for sure in some shape or form). |
Ok, I’m up to speed here. Without doing the volume provisioning aspect using this driver with nomad as it stands today doesn’t really provide much/anything.
Each of the above could just as easily provide the features you would get from this with the current state of nomad support. However, if you want to prepare yourself to seamlessly work with the hypothetical future enhancements to nomad with the volumes you’re provisioning now, then using this driver from the beginning would make that path seamless. We’ll get some samples here for you to review of what creation would look like and subsequently how to configure nomad after creating a volume. Are you initially interested in iscsi or nfs and are you using truenas or ZoL? |
I'm currently using truenas and nfs. I've already got somewhat of a working setup with nfs, I was just interested in seeing if I could get this working. I've found a couple libraries, so I'll take a look at potentially putting together a generic csi terraform provider. I've gone ahead and attached the nomad job files just incase anyone else comes across this and tries to get it running with nomad. Controller:
Node:
|
Yeah perfect. I’ll send over some examples of creating a volume and then subsequently how you would format things in nomad to consume/attach (or at least how I think it would be based on the examples I’ve seen floating around). |
Sounds good. Registering a volume with nomad is documented here, and it seems like its mostly just the parameters from the CSI spec formatted as HCL, however, I am not very familiar with the CSI. |
I think in the case of how this project does it we’ll need mount_opts, parameters, and context. Secrets may be necessary if running iscsi with chap, but otherwise generally not. |
I'm having a bit of trouble getting the controller to actually listen on a tcp socket. I tried
|
That arg is specifically for the socket. Use |
Thank you for all your help! Its getting quite late where I am, but I did manage to get some stuff working, and it does seem like Nomad support is possible! Using this cli, I was able to create a new volume and get the following response back.
I then tried to register that volume in nomad using the following config and it worked perfectly!
Couple notes:
After going through the steps, I don't think there is any need to have any terraform provisioner or anything else. Nomad will eventually have the ability for native volume provisioning, so a simple set of shell scripts or similar is a good enough stop gap. I'm going to take all the discussion here and turn it into a proper How-To guide on using democratic-csi with Nomad in the next couple of days, so that future users can make use of this awesome project! |
Awesome! It looks like you mapped that out perfectly! The helm chart examples are actually the best source of doc on this front currently: Regarding 1:
Regarding 2:
Regarding 3:
I’ll review the binary to create the volumes to see if it’s flexible enough to handle the common use cases and if not we could include a binary/client in this project as well which could easily be invoked using docker. |
The I've gone ahead and created a PR to add Nomad docs, and once Nomad supports volume management, I'll update them. They aren't too great, but they should make it easier for anyone who wants Nomad support right now. Everything seems to be working pretty well, thank you for all your help! |
@aditsachde would you mind posting a gist example of your Nomad config for NFS? I'm having a bit of trouble piecing together one from the k8s examples in this project. I have already created an NFS share. Thanks! |
Hey, I'd written up some docs here that has some examples. Unfortunately, I was experiencing some stability issues with nomad and didn't really like certain aspects, so I am no longer using it. |
Yes I did see the job spec in the docs but I'm still a bit mystified on the actual config yaml. |
What can I help with on the config yaml? You need help with the actual contents or how to get the file injected to a container properly etc? |
I have a question regarding the config yaml for an iscsi node job. What goes in the I can't figure that part out. I was able to set it up for NFS, but I'd like to have both options, as iscsi works better in some cases. |
Use exactly the same files as you use for the controller aspect. Assuming FreeNAS you can base it off of this: https://github.com/democratic-csi/democratic-csi/blob/master/examples/freenas-iscsi.yaml |
Sorry to keep posting in a closed issue, however I'm facing what I believe to be a similar issue to @dkowis. Before launching into a full diatribe given that Nomad support is tertiary at best, this is what i see when executing
The following is known-good (i think, ha):
Some basics of the env:
However the node processes never seem to actually claim a volume. I'm very positive that I'm missing some small stupid detail, and i suspect it has to do with the, what seems to me, truncated list of capabilities returned by a node when queried using csc (I forked to update I'm very new to attempting to utilize CSI plugins in general, and also don't spend a ton of time in more modern javascript repos, so i'm having a bit of trouble determining where exactly the list of capabilities is being built. I see lots of references to Any help would be appreciated. I may eventually let nomad go in favor of k8s, but it'd be great if I could get this going and perhaps flesh out / help flesh out the nomad documentation more. Another thought: Do I need to mount host iscsi resources into the container? I see lots of references to conditional mounts in the charts repo. |
@dcarbone welcome! Maybe let's open another issue with the details to discuss further. Unfortunately The Regarding host mounts, yes there are several changes that are slightly different using iscsi vs nfs. I highly suggest reading the conversation over here #111 (and maybe just using that issue to continue the conversation if it makes sense) as it gives some details on running with iscsi. On my end, I think it's time I setup a single node |
@travisghansen that sounds fine with me! My suspicion is based entirely on ignorance, heh. I figured i'd see something about mounting, but I'm pretty sure that's just me conflating node and volume capabilities. I'll review that issue and if i can find something more tangible i'll open another ticket. Thanks! |
Sounds good. I'm going to attempt a single-node Yes node and volume caps are distinct concepts. I don't think that particular thing is your issue. |
Running into some issues with
but am getting the error
which makes me feel as though the controller is able to create volumes. Any advice? |
@AidanHanda you need to specify the capabilities of the volume itself :) Have a look at the source here: https://github.com/rexray/gocsi/blob/master/csc/cmd/controller_create_volume.go#L34 An example would be:
|
Thanks @dcarbone! Obviously 🤦 ! |
Note that with recent versions of Nomad csc is no longer required and you can manage everything end to end with Nomad-native assets/commands. |
Thank you for making this extremely useful project! This is kind of a shot in the dark, but I've been attempting to get this project working with Nomad with its CSI support. I've got the software running properly, however, Nomad does not currently support creating volumes. Rather, an existing volume has to be registered with Nomad. I was wondering if there was any way to manually create a CSI volume that I can then register with Nomad.
The text was updated successfully, but these errors were encountered: