kubernetes

How to add a custom allocatable type in Kubernetes?


In limits/requests you can specify the amount of "cpu" and "memory" a Pod needs. Also there are custom allocatables like "nvidia.com/gpu" in GKE.

How to add those custom ones? I'd like to create my generic one "generic-gpu" and some kind of controller behind it that would look at the state of the cluster and run it on either a GPU node or a software rendering node (or on a custom GPU node).

Admission webhooks look promising (mutating admission webhook), but it seems that they're not as good as having real allocatables.


Solution

  • Ok, it's done through Device Plugins that run on the nodes. They advertise custom resources a node might have.