Closed 116davinder closed 10 months ago
I have checked the code for rocketduck/csi-plugin-nfs and it is dead simple where it expects a system path for mounting a dir but it gets arget_path: "/local/csi/per-alloc/c675ac86-215a-7487-1522-a1416112f087/kerberos-backup/rw-file-system-multi-node-multi-writer"
and since it doesn't create folder recursively, it fails with FileNotFoundError
as expected from python standpoint
os.mkdir(path, mode=0o777, *, dir_fd=None)¶ Create a directory named path with numeric mode mode. If the directory already exists, FileExistsError is raised. If a parent directory in the path does not exist, FileNotFoundError is raised.
I manage resolve this error by setting stage_publish_base_dir = "/tmp/csi"
. For some reason containerd driver doesn't allow creating folders at /local/csi
and that's why csi-plugin fails.
Flow of mount process
stage_publish_base_dir
"Mounts": [
{
"Type": "bind",
"Source": "/opt/nomad/data/client/csi/monolith/rocketduck-nfs/per-alloc/77c4d1d8-0fb7-83e0-f35a-5c2cf35c35d7/kerberos-backup/rw-file-system-multi-node-multi-writer",
"Destination": "/alloc/backups",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
]
Example exec driver: I don't know yet, how it binds the nfs path from container because, I can't make nfs mount working yet.
As of now, when I am running csi-plugin with containerd-driver
it doesn't expose nfs mount to the system but it does mount the bfs path within the container where as docker driver is able to mount the nfs inside and outside the container.
Hi @116davinder 👋
Thanks for the report and the detailed info. Just so I understand the status here, is this a fair summary of things?
rocketduck/csi-plugin-nfs
CSI plugin as a containerd
task. Changing the value for csi_plugin.stage_publish_base_dir
to a path outside the local
directory fixed the problem.exec
driver is not able to mount a CSI volume.For some reason containerd driver doesn't allow creating folders at /local/csi and that's why csi-plugin fails.
Is https://github.com/Roblox/nomad-driver-containerd the plugin you're using? If so, that's a community plugin that I don't know enough to provide any guidance. Perhaps you could open an issue in that repo? Another thing to try would be to use the NOMAD_TASK_DIR
environment variable instead of hardcoding /local
.
Since i am using containerd and exec in my stack a lot, I am blocked because of missing feature / Issues
Early Notes for Docker Driver with CSI NFS Plugin
Last, I do agree that containerd related issue should be moved to Robox/Containerd Repo.
I am closing this issue, since docker driver is only supported and working with CSI NFS Plugins.
Nomad version
Output from
nomad version
Nomad server: 1.6.3 Nomad Client: 1.6.3Operating system and Environment details
Ubuntu 20.04
Issue
NFS CSI Volume Mount Fails
What i haven't understood so far is that why Nomad is asking for this
'/local/csi/per-alloc/d992204d-637c-2cde-2ba7-4633fd7688e1/kerberos-backup/rw-file-system-multi-node-multi-writer'
instead of what i have mentioned in the job spec/mnt/backups
Any pointers will be much appreciated.
Reproduction steps
variable "nfs_server_path" { type = string default = "/backup/nomad-dev-dynamic-volumes" description = "this path should exist in the nfs" }
variable "controller_count" { type = number default = 1 }
job "csi-nfs-controller" {
remove the constraint
constraint { attribute = "${attr.unique.hostname}" value = "dev-kdc01" }
group "nfs" { count = var.controller_count
} }
Step-3 Attach the volume using exec/containerd driver based job ---- not working
Expected Result
Volume mount inside the exec driver chroot or job folder.
Actual Result
Nomad Server logs (if appropriate)
N/A
Nomad Client logs (if appropriate)
NFS Controller/Node Logs (if appropriate)
Other Information / References