Replies: 1 comment
-
I was trying to use "podman generate kube" against one of my pods, and there is a container that has a --device specified. The device did not show up in the printed Kubernetes YAML so I must assume my issue is the same as this question. If so, then I would agree, this feature would be handy to make it transparent to the user. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Kubernetes provides ways to map devices into pods and containers.
One way is to map devices into containers via volumes but this requires privileged containers.
The more flexible way to add devices tvia Kubernetes Device Plugins
It abstracts the provisioning and mapping of devices to containers. So when specifying a Pod it's only needed to add an abstract name of the hardware, e.g.
hardware-vendor.example/foo
and the amount of it. The device plugin will then take care of making this available to containers. In YAML this will look like:For
podman kube play
it would be useful to also support thisresources.limits
to map devices. As this would allow to deploy the same pod spec on both Kubernetes and podman and it would be transparent to the user.However I don't think it makes sense to implement the full device plugin interface as it assumes a daemon (kubelet) running.
So for podman I think a better option is to implement a kind of hook mechanism that would get
resource.limits
and outputs the required--devices
parameters, that would be applied before the pod is run.Beta Was this translation helpful? Give feedback.
All reactions