<p>When I run the command on my SBC:</p>
<pre class="lang-sh prettyprint-override"><code>docker run --volume $(pwd):/home/octoprint --device /dev/ttyUSB0:/dev/ttyACM0 -p 5000:5000 --name octoprint octoprint/octoprint:1.4.0-python3
</code></pre>
<p>Everything works normally; I can open the octoprint screen and my 3D printer is recognized without any problems.</p>
<p>However, when I try to run the equivalent <code>--device /dev/ttyUSB0:/dev/ttyACM0</code> to be mapped as any type of volume as possible, I am unable to make an equivalent configuration.</p>
<p>Please, how do I get Rancher to recognize a <code>--device</code>?</p>

Lucas Almeida Carotta
<p>Assuming you are talking about Kubernetes Rancher. The <a href="https://github.com/kubernetes/kubernetes/issues/5607#issuecomment-258195005" rel="nofollow noreferrer">common</a> way is to use <code>privileged</code> in the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" rel="nofollow noreferrer">SecurityContext</a> of your Pod or Container.</p>
<p>For example:</p>
<pre class="lang-yaml prettyprint-override"><code>  containers:
  - name: sbc
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /dev/ttyUSB0
      name: ttyacm
  volumes:
  - name: ttyacm
    hostPath:
      path: /dev/ttyACM0
</code></pre>
<p>A more advanced way of supporting host devices is <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/" rel="nofollow noreferrer">Device Plugins</a>. But I believe of standard USB the above should work. You might also want to use <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/" rel="nofollow noreferrer">NodeAffinity</a> to make sure that your Pod lands where your device is.</p>
<p>✌️</p>
