Kubernetes 1.26: Device Manager graduates to GA
source link: https://kubernetes.io/blog/2022/12/19/devicemanager-ga/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Kubernetes 1.26: Device Manager graduates to GA
Author: Swati Sehgal (Red Hat)
The Device Plugin framework was introduced in the Kubernetes v1.8 release as a vendor independent framework to enable discovery, advertisement and allocation of external devices without modifying core Kubernetes. The feature graduated to Beta in v1.10. With the recent release of Kubernetes v1.26, Device Manager is now generally available (GA).
Within the kubelet, the Device Manager facilitates communication with device plugins
using gRPC through Unix sockets. Device Manager and Device plugins both act as gRPC
servers and clients by serving and connecting to the exposed gRPC services respectively.
Device plugins serve a gRPC service that kubelet connects to for device discovery,
advertisement (as extended resources) and allocation. Device Manager connects to
the Registration
gRPC service served by kubelet to register itself with kubelet.
Please refer to the documentation for an example on how a pod can request a device exposed to the cluster by a device plugin.
Here are some example implementations of device plugins:
Noteworthy developments since Device Plugin framework introduction
Kubelet APIs moved to kubelet staging repo
External facing deviceplugin
API packages moved from k8s.io/kubernetes/pkg/kubelet/apis/
to k8s.io/kubelet/pkg/apis/
in v1.17. Refer to Move external facing kubelet apis to staging for more details on the rationale behind this change.
Device Plugin API updates
Additional gRPC endpoints introduced:
GetDevicePluginOptions
is used by device plugins to communicate options to theDeviceManager
in order to indicate ifPreStartContainer
,GetPreferredAllocation
or other future optional calls are supported and can be called before making devices available to the container.GetPreferredAllocation
allows a device plugin to forward allocation preferrence to theDeviceManager
so it can incorporate this information into its allocation decisions. TheDeviceManager
will call out to a plugin at pod admission time asking for a preferred device allocation of a given size from a list of available devices to make a more informed decision. E.g. Specifying inter-device constraints to indicate preferrence on best-connected set of devices when allocating devices to a container.PreStartContainer
is called before each container start if indicated by device plugins during registration phase. It allows Device Plugins to run device specific operations on the Devices requested. E.g. reconfiguring or reprogramming FPGAs before the container starts running.
Pull Requests that introduced these changes are here:
With introduction of the above endpoints the interaction between Device Manager in kubelet and Device Manager can be shown as below:
Device Plugin framework Overview
Change in semantics of device plugin registration process
Device plugin code was refactored to separate 'plugin' package under the devicemanager
package to lay the groundwork for introducing a v1beta2
device plugin API. This would
allow adding support in devicemanager
to service multiple device plugin APIs at the
same time.
With this refactoring work, it is now mandatory for a device plugin to start serving its gRPC service before registering itself with kubelet. Previously, these two operations were asynchronous and device plugin could register itself before starting its gRPC server which is no longer the case. For more details, refer to PR #109016 and Issue #112395.
Dynamic resource allocation
In Kubernetes 1.26, inspired by how Persistent Volumes are handled in Kubernetes, Dynamic Resource Allocation has been introduced to cater to devices that have more sophisticated resource requirements like:
- Decouple device initialization and allocation from the pod lifecycle.
- Facilitate dynamic sharing of devices between containers and pods.
- Support custom resource-specific parameters
- Enable resource-specific setup and cleanup actions
- Enable support for Network-attached resources, not just node-local resources
Is the Device Plugin API stable now?
No, the Device Plugin API is still not stable; the latest Device Plugin API version
available is v1beta1
. There are plans in the community to introduce v1beta2
API
to service multiple plugin APIs at once. A per-API call with request/response types
would allow adding support for newer API versions without explicitly bumping the API.
In addition to that, there are existing proposals in the community to introduce additional endpoints KEP-3162: Add Deallocate and PostStopContainer to Device Manager API.
Recommend
-
73
除非特别声明,此文章内容采用知识共享署名 3.0许可,代码示例采用Apache 2.0许可。更多细节请查看我们的服务条款。
-
51
On August 9th, 2018 the Cloud Native Computing Foundation (CNCF) announced open source monitoring toolkit, Prometheus, has graduated from...
-
42
Predictions graduates to general availability to provide smarter user segmentation 2018-11-16adminF...
-
99
Meet the Grow with Google Developer Scholarships graduates 2018-11-...
-
41
CoreDNS, a cloud-native DNS server commonly used for dynamic DNS-based service discovery has become the first Cloud Native Computing Foundation (CNCF)
-
8
Warren Buffett advised graduates to read, polish their communication skills, and find a job they love in a virtual address. Here are the 11 best quotes.
-
7
Hyperledger Aries Graduates To Active Status; Joins Indy As “Production Ready” Hyperledger Projects for Decentralized Identity – HyperledgerThe Hyperledger Technical Steering Committee (TSC) has approved
-
6
Article How KindWork trains and graduates underserved students into tech jobs The nonprofit’s free training program helps youn...
-
8
The Cloud Native Computing Foundation (CNCF) tells us that it’s on a mission.Content Continues Below
-
3
Kubernetes 1.25: cgroup v2 graduates to GAWednesday, August 31, 2022Authors:: David Porter (Google), Mrunal Patel (Red Hat)Kubernetes 1.25 brings cgroup v2 to GA (general availability), lett...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK