Skip to content
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

Accessing host instance devices... #145

Open
derailed opened this issue Nov 17, 2016 · 3 comments
Open

Accessing host instance devices... #145

derailed opened this issue Nov 17, 2016 · 3 comments

Comments

@derailed
Copy link

I am aware that k8s does not support docker option --device. So I've resorted to use the security context privileged:true when defining a pod. This however does not yield the expected results on having the container access the instance devices.

NOTE: both the api server and kubelet are running with allow-privileged: true

I can run the exact docker image on the node manually with --privileged: true and the container performs nominally. However launching the container via k8s, the application can no longer access the devices. Looking further, and running docker inspect on the docker and k8s container, I can see the k8s is running in privileged mode as expected however there is a delta in both the security context and devices settings. Docker says devices: [] while K8s container says devices: null.
Thinking that might be the root cause of this issue but not super sure??

Has anyone been able to access /dev or /sys/class on the host instance from a k8s instantiated image? Any thoughts or workarounds?

@derailed derailed changed the title Accessing instance devices... Accessing host instance devices... Nov 17, 2016
@luxas
Copy link
Owner

luxas commented Nov 17, 2016

Have you tried using the hostPath volume?

@derailed
Copy link
Author

Tx Lucas! I did try the volume mounts and thought that would work, but
ended it being a dud.

I'll give it another rinse, perhaps I've missed something in the
excitement. I'll update with my findings.

On Thu, Nov 17, 2016 at 7:42 AM, Lucas Käldström [email protected]
wrote:

Have you tried using the hostPath volume?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#145 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAP3LK22cg_B_QH0jEpCuMIbfS4qf5nks5q_GfygaJpZM4K1YaQ
.

@derailed
Copy link
Author

Again thank you Lucas for prompting me to revisit. You Rock!!

Turns out one on the mount points symlinked to another dir that I was not
mounting ;-(
My stuff is running like a champ now.

Thank so much for your contributions and excellent input!

On Thu, Nov 17, 2016 at 9:02 AM, Fernand Galiana [email protected]
wrote:

Tx Lucas! I did try the volume mounts and thought that would work, but
ended it being a dud.

I'll give it another rinse, perhaps I've missed something in the
excitement. I'll update with my findings.

On Thu, Nov 17, 2016 at 7:42 AM, Lucas Käldström <[email protected]

wrote:

Have you tried using the hostPath volume?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#145 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAP3LK22cg_B_QH0jEpCuMIbfS4qf5nks5q_GfygaJpZM4K1YaQ
.

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

No branches or pull requests

2 participants