-
Notifications
You must be signed in to change notification settings - Fork 101
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_csi_volume missing context block #417
Comments
Just as some extra info on this one, I tried crating the volume via a volume specification file with the same information that the nomad_csi_volume resource has and It successfully created without returning the unsupported node_attach_driver error. |
Hi @CarbonCollins 👋 According to the docs volume context should only be set on volume registration, that's why it's only present in the Could you share the volume spec you used to create the volume that worked? |
Likewise I also am used to specifying context within the volume declaration and then just using
However I was able to get the provider to accomplish what I need without my PR by connecting the volume and volume registration blocks. I did find some things had to be re-declared as well, though this could be my csi provider.
|
Sure its pretty much the following Terraform format that did not work: resource "nomad_csi_volume" "loki_data" {
count = 1
depends_on = [data.nomad_plugin.storage]
lifecycle {
prevent_destroy = true
}
namespace = "c3-monitoring"
plugin_id = data.nomad_plugin.storage.plugin_id
volume_id = format("loki-data[%d]", count.index)
name = format("loki-data[%d]", count.index)
capacity_min = "1GiB"
capacity_max = "2GiB"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
mount_options {
fs_type = "cifs"
mount_flags = [
"vers=3.0",
format("uid=%d", var.cifs_user_id),
format("gid=%d", var.cifs_group_id),
"file_mode=0600",
"dir_mode=0700",
"noperm",
"nobrl",
format("username=%s", data.vault_kv_secret_v2.volume_credentials.data["user"]),
format("password=%s", data.vault_kv_secret_v2.volume_credentials.data["pass"])
]
}
} the nomad volume equivilant that did work: id = "loki-data[0]"
name = "loki-data[0]"
type = "csi"
plugin_id = "soc-axion-smb"
capacity_min = "1GiB"
capacity_max = "2GiB"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
mount_options {
fs_type = "cifs"
mount_flags = [
"vers=3.0",
"uid={redacted}",
"gid={redacted}",
"file_mode=0600",
"dir_mode=0700",
"noperm",
"nobrl",
"username={redacted}",
"password={redacted}",
]
}
context {
node_attach_driver = "smb"
} |
Thanks for the extra info @clarkbains and @CarbonCollins! Do you happen to have plugin logs for the volume creation using Terraform (so the one without The |
I dont have any of the previous logs, but I could try generating some new ones with a new volume |
Terraform apply log
|
Thanks! So the volume is created successfully but you can't mount it to a task? If you read the volume back (like using And when the error you reported actually happens, do you have see anything in the CSI plugin logs? (meaning, the CSI plugin job allocations you ran). |
Just checked the nomad operator api call and it seems to have populated the context correctly here... I see the "node_attach_driver": "smb"... I have not deployed a job to use the volume yet to verify that it works on mounting but at least from the api call it seems to have been set correctly here at least |
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Terraform v1.6.6
on linux_amd64
Nomad Version
1.7.2
Provider Configuration
Which values are you setting in the provider configuration?
Environment Variables
Do you have any Nomad specific environment variable set in the machine running Terraform?
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
be able to define context block on the nomad_csi_volume resource like you can with the nomad_csi_volume_registration
Actual Behavior
You are unable to define the context block on the nomad_csi_volume resource
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
There is nothing atypical but when I tried to deploy my job to one of the volumes created and registered via the terraform provider my Nomad job wont start with the error:
References
context docs in (csi_volume_registration - context)[https://registry.terraform.io/providers/hashicorp/nomad/latest/docs/resources/csi_volume_registration#context]
The text was updated successfully, but these errors were encountered: