Kubernetes cluster-oriented equipment resource unified management system and method

By introducing device plug-in managers and injectors into Kubernetes clusters, device resources are unified managed and abstracted, which solves the complexity of operation and maintenance problems caused by differences in device resources from multiple vendors, and achieves imperceptible use of resources and simplified management.

CN118535280APending Publication Date: 2024-08-23KYLIN CORP
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410548558.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

When there are multiple device resources from different manufacturers in a Kubernetes cluster, operation and maintenance management becomes complicated, and users need to perceive the differences in device resources from different manufacturers, making scheduling and resource allocation difficult.

Method used

A device resource unified management system for Kubernetes clusters is designed, including a device plug-in manager and an injector. It generates a resource file list by parsing configuration files, shields differences in device resources, and achieves unified management and abstraction. The device plug-in manager is set between the kubelet component and the device resource, and the injector is set between the runtime component and the container, listening to the kubelet's creation request, intercepting operations and injecting the resource file list.

Benefits of technology

It simplifies the management and operation of cluster components and resources. Users do not need to pay attention to which manufacturer provides specific device resources. It shields the differences in multiple device resources from different underlying manufacturers and reduces the complexity of deployment and installation of device plug-in services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535280A
    Figure CN118535280A
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and particularly provides a kubernetes cluster-oriented equipment resource unified management system and method, and the system comprises an equipment plug-in manager and an injector, the device plug-in manager returns a corresponding device allocation result according to the resource request of the kubelet component and generates a resource file list of the managed device by analyzing a configuration file input by a user; and the injector monitors a creation request of the kubelet component, performs an interception operation when the kubelet component calls the runtime component, acquires a resource file list of the target equipment from a corresponding file directory, creates a container, and injects the resource file list of the target equipment into the container. The technical problem that when multiple device resources of multiple different manufacturers exist in the Kubernetes cluster, operation and maintenance management work of the cluster is difficult is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and specifically provides a unified management system and method for device resources of a Kubernetes cluster. Background Art

[0002] With the popularity of big data, machine learning, large models and other artificial intelligence fields, the industry's demand for computing resources has become increasingly prominent. The rapid development of artificial intelligence has also further accelerated the development of cloud computing and device resources. At present, container orchestration technologies such as Kubernetes are the main technical standards in cloud computing, and the support for device resources is mainly implemented in Kubernetes through the Device Plugin interface. Device Plugin provides a standardized mechanism for Kubernetes clusters, allowing various types of device resources to be easily discovered, registered and used by Kubernetes clusters dynamically.

[0003] Currently, in order to use device resources on the Kubernetes platform, two operations must be provided. The first is to provide a unified external exposure method for device resources, and the second is to achieve unified management of device resources.

[0004] Provide a unified way to expose device resources: Kubernetes provides a unified extended interface for device resources, namely the Extended Resources interface. When implementing it, device resources are defined and used in a specific format (for example, NVIDIA's GPU resources can be used in the format of nvidia.com / gpu). If users want to define their own device resources, they also need to follow the corresponding format to use the device resources.

[0005] Unified management of device resources: Kubernetes provides the Device Plugin abstract interface to manage device resources. Third-party manufacturers (such as NVIDIA) need to implement the corresponding Device Plugin interface functions to manage device resources.

[0006] Since different manufacturers have different management logics for device resources, when the cluster is large and there are multiple device resources from multiple different manufacturers in the same Kubernetes cluster, it will cause great difficulties for cluster operation and maintenance and scheduler scheduling. Therefore, how to effectively manage multiple device resources from multiple manufacturers in the same cluster and allow users to use these device resources without noticing is a difficult problem faced by the industry. Summary of the invention

[0007] In order to overcome the above-mentioned defects, the present invention is proposed to solve the technical problem that the operation and maintenance management of the cluster is difficult when there are multiple device resources from multiple different manufacturers in the Kubernetes cluster.

[0008] In a second aspect, the present invention proposes a unified device resource management system for a kubernetes cluster, including a device plug-in manager and an injector. The device plug-in manager is set between the kubelet component and the device resources, returns the corresponding device allocation result according to the resource request of the kubelet component, and generates a resource file list of the managed device by parsing the configuration file input by the user; The injector is set between the runtime component and the container. By listening to the creation request of the kubelet component, it intercepts the operation when the kubelet component calls the runtime component, obtains the resource file list of the target device from the corresponding file directory, creates a container, and injects the resource file list of the target device into the container.

[0009] Further, the device plug-in manager includes: The configuration file loader obtains the basic information of the managed device and the operation information of the managed device by parsing the configuration file input by the user; The device discoverer obtains the detailed information of the managed device by calling the API interface of the managed device driver; The device resource converter generates a resource file list based on the detailed information of the managed device and the operation information of the managed device and saves it in the corresponding file directory of the system; The scheduling allocator is used to process the resource requests of the kubelet component, select the target device through the relevant scheduling strategy, and return the allocation result to the kubelet component.

[0010] Furthermore, the basic information of the managed device includes the device manufacturer and device model, and the detailed information of the managed device includes the number of devices, mount point information, directory information mapped to the target, and driver library information.

[0011] Furthermore, the device plug-in manager establishes a connection with the kubelet component through a sock interface.

[0012] In a second aspect, the present invention proposes a unified management method for device resources of a kubernetes cluster, comprising the steps of: S101: Parse the configuration file input by the user to obtain basic information of the managed device and operation information of the managed device; S102: Calling the API provided by the manufacturer to obtain detailed information of the managed device; S103: Generate a resource file list according to the detailed information of the managed device and the operation information on the managed device and save it in a corresponding file directory of the system.

[0013] Furthermore, the method further comprises the steps of: S201: After receiving the resource request from the kubelet component, select the target device through the relevant scheduling strategy, and return the allocation result to the kubelet component; S202: Listen to the creation request of the kubelet component, and intercept the kubelet component when it calls the runtime component; S203: Obtain a resource file list of the target device from the corresponding file directory; S204: Create a container, and inject the resource file list of the target device into the container.

[0014] Working principle and beneficial effects of the present invention: In the technical solution of the present invention, the device resource management function is implemented through the device plug-in manager, and the device plug-in manager generates a corresponding resource file list for the managed device. When in use, the injector creates a container by calling the resource file list of the target device, shielding the perceived differences of different device resources. Through this solution, the upper layer kubernetes uses unified abstracted resources, and does not need to pay attention to which third-party manufacturer provides the specific device resources. The differences in multiple device resources of different manufacturers at the bottom layer can be shielded. In the same cluster, it is no longer necessary to deploy and install different device plugin plug-in services, which will greatly simplify the management and operation of cluster components / resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which: Figure 1 This is the main structural diagram of a unified management system for device resources of a Kubernetes cluster according to the present invention; Figure 2 This is a schematic flow chart of the main steps of step S1 in the device resource unified management method of the present invention; Figure 3 It is a flowchart of the main steps of step S2 in the device resource unified management method of the present invention. DETAILED DESCRIPTION

[0016] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0017] Here we first explain some terms involved in the present invention.

[0018] kubenetes: often referred to as k8s, is an open source container orchestration platform for automating the deployment, expansion and management of applications. It provides a comprehensive management solution for containerized applications, which can handle tasks such as container deployment, scaling, load balancing, and fault recovery.

[0019] Kubelet: It is a core component in kubernetes, responsible for managing containers on a single node and communicating with the kubernetes control plane. A kubelet process runs on each node, which works with the container runtime (such as Docker), Pod network, and kubelets on other nodes.

[0020] Runtime: In Kubernetes, the container runtime is the software component responsible for actually running and managing containers. It implements the Open Container Initiative (OCI) specification, ensures that containers are portable between different container runtimes, and is responsible for handling operations such as creating, starting, stopping, and destroying containers. Common container runtimes include Docker, containerd, CRI-O, etc.

[0021] OCI (Open Container Initiative): is an open container standard that aims to define container formats and runtime standards to ensure that containers are portable between different container runtimes. OCI is supported by the Linux Foundation and has been widely adopted by the container ecosystem. OCI mainly includes two specifications: container format specification (Image Specification) and runtime specification (Runtime Specification). Example 1

[0022] This embodiment proposes a unified device resource management system for a kubernetes cluster, which is mainly used on worker nodes containing device resources. The specific workflow of the system is described in Example 2. Specifically, this embodiment is described by taking the KylinOS system as an example.

[0023] Figure 1 This is the main structural diagram of a unified management system for device resources in a Kubernetes cluster. Figure 1 As shown, a unified device resource management system for a kubernetes cluster in this embodiment mainly includes a device plug-in manager and an injector.

[0024] 1. Device Plugin Manager The device plugin manager is set between the kubelet component and the device resources, and establishes a connection with the kubelet component through the sock interface. The device plugin manager solves the problem of Kubernetes cluster management.

[0025] Specifically, the device plug-in manager includes a configuration file loader, a device discoverer, a device resource converter, and a scheduling distributor, wherein: The configuration file loader parses the configuration file input by the user to obtain the basic information of the managed device (device manufacturer, device model, etc.) and the operation information of the managed device. The user is configurable, and the configuration file loader can dynamically manage the device resources that the user needs to manage according to the modification of the configuration file.

[0026] The device discoverer obtains detailed information about the managed device (number of devices, mount point information, directory information mapped to the target, driver library information, etc.) by calling the API interface of the managed device driver. The device discoverer only processes the devices specified in the configuration file (i.e., managed devices) to achieve dynamic discovery of device resources. This can narrow the scope of devices that need to be managed, manage the underlying device resources according to user needs, shield the underlying device resource details, and simplify the processing logic.

[0027] The device resource converter generates a resource file list based on the detailed information of the managed device and the operation information of the managed device and saves it in the corresponding file directory of the system (such as / var / devices / xxx.devs).

[0028] The scheduling allocator is used to process the resource requests of the kubelet component, select the target device through the relevant scheduling strategy, and return the allocation result to the kubelet component for subsequent processing.

[0029] Through the above configuration, the device plug-in manager can discover and manage various underlying device resources, shield various differences in underlying devices, realize the abstraction of device resources, and facilitate users to set the device resources that need to be managed and used through configuration files. At the same time, it establishes contact with the upper layer kubernetes to process resource requests. Specifically, the device plug-in manager will report device resources in a specific format to kubernetes (such as: kylinos.io / device.gpus=8 means that there are 8 gpus type devices in the lower layer). kubernetes can use the abstracted device resources, no longer need to apply for resources according to the manufacturer's definition, and users do not need to be aware of the existence of the manufacturer.

[0030] 2. Injector The injector is set between the runtime component and the container, solving the problem of Kubernetes cluster resource usage.

[0031] Specifically, the injector listens to the creation request of the kubelet component, intercepts the kubelet component when it calls the runtime component and before the runtime component creates the container, and obtains the resource file list of the target device from the corresponding file directory of the KylinOS system (such as / var / devices / xxx.devs). After obtaining it, it creates a container through the runtime component and injects the resource file list of the target device into the container according to the OCI standard. Example 2

[0032] This embodiment proposes a unified management method for device resources of a kubernetes cluster, which is based on the above-mentioned unified management system for device resources of a kubernetes cluster. The unified management method for device resources mainly includes two steps, namely: Step S10: Create a resource file list of devices that the user needs to manage; Step S20: calling device resources.

[0033] Figure 2 Schematic diagram of the main steps of step S1 in the device resource unified management method of the present invention. Figure 2 As shown, step S10 specifically includes the following steps S101-S103.

[0034] S101: Parse the configuration file input by the user to obtain basic information of the managed device and operation information of the managed device; S102: Calling the API provided by the manufacturer to obtain detailed information of the managed device; S103: Generate a resource file list according to the detailed information of the managed device and the operation information on the managed device and save it in a corresponding file directory of the system.

[0035] Figure 3 1 is a schematic flow chart of the main steps of step S2 in the method for unified management of device resources of the present invention. Figure 3 As shown, step S20 specifically includes the following steps S201-S204.

[0036] S201: After receiving the resource request from the kubelet component, select the target device through the relevant scheduling strategy, and return the allocation result to the kubelet component; When users use resources, they first submit tasks through kubernetes. kubernetes will create corresponding pods to apply for resources. The specific application logic is to apply on each node through the kubelet component. After the kubelet component on the node obtains the resource application information from the upper kubernetes, it will call the scheduling allocator in the device plug-in manager. The scheduling allocator will have a strategy specifically for scheduling device resources. After the scheduling allocator completes the allocation, it will return the result to the kubelet component. The kubelet component will call the runtime component again to create a container. The created container will use the device just allocated in the scheduling allocator.

[0037] S202: Listen to the creation request of the kubelet component, and intercept the kubelet component when it calls the runtime component; S203: Obtain a resource file list of the target device from the corresponding file directory; S204: Create a container, and inject the resource file list of the target device into the container.

[0038] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.

[0039] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A unified management system for device resources of a kubernetes cluster, characterized in that: Includes device plugin manager and injector, The device plug-in manager is set between the kubelet component and the device resources, returns the corresponding device allocation result according to the resource request of the kubelet component, and generates a resource file list of the managed device by parsing the configuration file input by the user; The injector is set between the runtime component and the container. By listening to the creation request of the kubelet component, it intercepts the operation when the kubelet component calls the runtime component, obtains the resource file list of the target device from the corresponding file directory, creates a container, and injects the resource file list of the target device into the container.

2. According to claim 1, a unified device resource management system for a kubernetes cluster is characterized in that: The device plug-in manager includes: The configuration file loader obtains the basic information of the managed device and the operation information of the managed device by parsing the configuration file input by the user; The device discoverer obtains the detailed information of the managed device by calling the API interface of the managed device driver; The device resource converter generates a resource file list based on the detailed information of the managed device and the operation information of the managed device and saves it in the corresponding file directory of the system; The scheduling allocator is used to process the resource requests of the kubelet component, select the target device through the relevant scheduling strategy, and return the allocation result to the kubelet component.

3. A unified device resource management system for a kubernetes cluster according to claim 2, characterized in that: The basic information of the managed device includes the device manufacturer and device model, and the detailed information of the managed device includes the number of devices, mount point information, directory information mapped to the target, and driver library information.

4. The device resource unified management system for a kubernetes cluster according to claim 1, characterized in that: The device plugin manager establishes a connection with the kubelet component through the sock interface.

5. A unified management method for device resources of a kubernetes cluster, characterized in that: Includes steps: S101: Parse the configuration file input by the user to obtain basic information of the managed device and operation information of the managed device; S102: Calling the API provided by the manufacturer to obtain detailed information of the managed device; S103: Generate a resource file list according to the detailed information of the managed device and the operation information on the managed device and save it in a corresponding file directory of the system.

6. A method for unified management of device resources for a kubernetes cluster according to claim 5, characterized in that: Also includes the steps: S201: After receiving the resource request from the kubelet component, select the target device through the relevant scheduling strategy, and return the allocation result to the kubelet component; S202: Listen to the creation request of the kubelet component, and intercept the kubelet component when it calls the runtime component; S203: Obtain a resource file list of the target device from the corresponding file directory; S204: Create a container, and inject the resource file list of the target device into the container.

Citation Information

Cited By

  • Non-container application arrangement method and device based on Kubernetes CRI plug-in

    CN119621232A

  • Resource management method, electronic equipment and storage medium

    CN121037187A

  • Resource management method, electronic device, and storage medium

    CN121037187B