Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes node Device port (USB) mapping to POD? Or Swarm service --device mapping

Is it possible to map, the device port(USB port) of a worker node, to a POD? Similar to docker create --device=/dev/ttyACM0:/dev/ttyACM0

Is it possible? I checked the refence doc, but could not find anything.

In Docker service, is it possible to map --device port to service container(if I am running only 1 container)?

like image 902
jisan Avatar asked Mar 09 '17 14:03

jisan


1 Answers

You can actually get this to work. You need to run the container privileged and use a hostPath like this:

  containers:
  - name: acm
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /dev/ttyACM0
      name: ttyacm
  volumes:
  - name: ttyacm
    hostPath:
      path: /dev/ttyACM0
like image 117
Janos Lenart Avatar answered Nov 04 '22 09:11

Janos Lenart