Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

[local-volume] Add /dev to volume mount in helm template #783

Closed
msau42 opened this issue May 25, 2018 · 8 comments
Closed

[local-volume] Add /dev to volume mount in helm template #783

msau42 opened this issue May 25, 2018 · 8 comments
Assignees

Comments

@msau42
Copy link
Contributor

msau42 commented May 25, 2018

To support raw local block, we recommend creating a symlink to the device in the discovery directory. The provisioner daemonset spec needs a hostpath mount to /dev to be able to resolve the symlinks.
/area local-volume

@cofyc
Copy link
Contributor

cofyc commented May 26, 2018

hi, in which scenario provisioner cannot access device under /dev?

Provisioner runs in privileged mode by using helm chart, in my test, provisioner does not need /dev hostpath mount to access devices under /dev.

$ docker run -it  busybox sh -c 'ls /dev/sd*'
ls: /dev/sd*: No such file or directory
$ docker run -it  --privileged busybox sh -c 'ls /dev/sd*'
/dev/sda   /dev/sda1  /dev/sda2  /dev/sda5  /dev/sdb   /dev/sdc   /dev/sdd

@msau42
Copy link
Contributor Author

msau42 commented May 26, 2018

cc @jsafrane

@jsafrane
Copy link
Contributor

jsafrane commented Jun 1, 2018

Interesting, I did not know about /dev/ in privileged containers. Is is something new? Do all container runtimes support it?

@cofyc
Copy link
Contributor

cofyc commented Jun 5, 2018

not sure yet, i'll investigate it
/assign

@k8s-ci-robot
Copy link
Contributor

@cofyc: GitHub didn't allow me to assign the following users: cofyc.

Note that only kubernetes-incubator members and repo collaborators can be assigned.

In response to this:

not sure yet, i'll investigate it
/assign

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jsafrane
Copy link
Contributor

jsafrane commented Jun 6, 2018

I stumbled upon this today when testing containerized mounts.

privileged will give a snapshot of /dev to your container at the time when the container is created. Devices created after the container has started are not reflected there. That's not what we want.

@cofyc
Copy link
Contributor

cofyc commented Jun 6, 2018

tested locally, you're right!

without -v /dev:/dev

# docker run -it --privileged busybox sh
/ # stat -c %F /dev/testdev
stat: can't stat '/dev/testdev': No such file or directory
# run `mknod /dev/testdev c 1 5` in another terminal
/ # stat -c %F /dev/testdev
stat: can't stat '/dev/testdev': No such file or directory

with -v /dev:dev:

# docker run -it -v /dev:/dev --privileged busybox sh
/ # stat -c %F /dev/testdev
stat: can't stat '/dev/testdev': No such file or directory
# run `mknod /dev/testdev2 c 1 5` in another terminal
/ # stat -c %F /dev/testdev
character special file

I'll add /dev to volume mount.

@cofyc
Copy link
Contributor

cofyc commented Jul 2, 2018

/assign

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants