nokia / CPU-Pooler

A Device Plugin for Kubernetes, which exposes the CPU cores as consumable Devices to the Kubernetes scheduler.
BSD 3-Clause "New" or "Revised" License
93 stars 22 forks source link

Device Plugin misinterprets cpusets supplied in the standard Linux "range" notation #12

Closed Levovar closed 5 years ago

Levovar commented 5 years ago

Describe the bug For configured cpuset like this: "1-8,10-12,20-25,28" the Device Plugin advertises 4 CPUs to Device Manager. Problem is present for shared pool as well (4k will be advertised).

Expected behavior Range notation should be properly converted to a serialized list of cores inside the component

Additional context types.Pool should be converted to use the https://github.com/kubernetes/kubernetes/blob/b4211dea984aaa6063b05a131ad5846e0268877c/pkg/kubelet/cm/cpuset/cpuset.go package. This package already interprets ToSlice (for exclusive pools), and Size (for shared pools). By using the correct internal representation fixing https://github.com/Levovar/CPU-Pooler/blob/master/cmd/cpu-device-plugin/cpu-device-plugin.go#L94 becomes quite easy

Levovar commented 5 years ago

we will handle this one, just opened the issue for transparency