Kubernetes节点设备端口(USB)映射到POD吗?或Swarm服务-设备映射 [英] Kubernetes node Device port (USB) mapping to POD? Or Swarm service --device mapping

查看:177
本文介绍了Kubernetes节点设备端口(USB)映射到POD吗?或Swarm服务-设备映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将工作程序节点的设备端口(USB端口)映射到POD? 类似于docker create --device=/dev/ttyACM0:/dev/ttyACM0

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.

在Docker服务中,是否可以将--device port映射到服务容器(如果我仅运行1个容器)?

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

推荐答案

您实际上可以使它正常工作.您需要以特权方式运行容器,并使用如下所示的hostPath:

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

这篇关于Kubernetes节点设备端口(USB)映射到POD吗?或Swarm服务-设备映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆