CN114138421A - Intelligent resource control system and method for kubernets - Google Patents

Intelligent resource control system and method for kubernets Download PDF

Info

Publication number
CN114138421A
CN114138421A CN202111495503.7A CN202111495503A CN114138421A CN 114138421 A CN114138421 A CN 114138421A CN 202111495503 A CN202111495503 A CN 202111495503A CN 114138421 A CN114138421 A CN 114138421A
Authority
CN
China
Prior art keywords
resource
pod
unit
container
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111495503.7A
Other languages
Chinese (zh)
Inventor
郭进
詹赵林
郑文礼
王畅
林鑫
孙佳明
梅金东
黄小
王鑫
刘金华
黄文杰
李贺安
聂子璇
刘清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Original Assignee
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial Bank Co Ltd, CIB Fintech Services Shanghai Co Ltd filed Critical Industrial Bank Co Ltd
Priority to CN202111495503.7A priority Critical patent/CN114138421A/en
Publication of CN114138421A publication Critical patent/CN114138421A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing

Abstract

The invention provides an intelligent resource control system and method of kubernets, which relate to the technical field of cloud computing and comprise the following steps: resource pre-check service: before application deployment, resources fields are checked in advance, illegal large resource requests are rejected, and different initial resource values are set according to application types; resource computing service: calculating the resources required by the operation of the Container in the next time window according to the collected use condition of the Container resources; resource control service: according to the calculation result of the calculation service, starting an update service to complete the resource setting of the Container; resource update service: and acting on the working node, and being started by the resource control service to inform the Container name needing to be updated, so as to complete the setting of the resource. The invention can dynamically modify the resource of the Container in the Pod without restarting the Pod, and ensure that the Container can operate according to the expected resource utilization rate under the condition of not influencing the current service.

Description

Intelligent resource control system and method for kubernets
Technical Field
The invention relates to the technical field of cloud computing, in particular to an intelligent resource control system and method of kubernets.
Background
With the development of modern internet technology, the development and application frequency of cloud platform technology is higher and higher. The application of the container technology on the cloud platform is also becoming mainstream gradually, in the cloud platform, kubernets is an open source Docker container cluster management system of a cross-host cluster, is used for managing containerized applications on a plurality of hosts in the cloud platform, and provides a whole set of functions of resource scheduling, deployment operation, service discovery, capacity expansion, capacity reduction and the like for the containerized applications.
The invention patent with the publication number of CN112751913A discloses a network communication method and system across Kubernets clusters, which realizes direct connection and intercommunication among a plurality of clusters by connecting VXLAN links and IPsec links, so that a plurality of Kubernets clusters really form an organic and intercommunicated whole with higher isolation. The method comprises the following steps: a submariner-gateway component of a first node of any Kubernets cluster elects an active IPsec endpoint; the first node comprises a node with a gateway tag; the active IPsec endpoint of any Kubernetes cluster is used for establishing connection with active IPsec endpoints of other Kubernetes clusters; a sub-router-agent component of the active IPsec endpoint establishes a VXLAN VTEP network interface; a sub-router-agent component of a second node of any Kubernetes cluster acquires information of the active IPsec endpoint; the second node comprises a set of containers Pod and/or container; a sub-router-agent component of a second node of any Kubernetes cluster is connected with the VXLAN VTEP network interface; and the second node communicates with any node of other Kubernetes clusters through a VXLAN link and an IPsec link.
In the kubernets cluster, the resource use condition of the Pod is controlled by setting resource limits and requests, but in the application running process, the resource use rate is too low or OOM caused by too large or too small preset values exists, and the Pod is restarted by conventional modification of the limits or requests values, so that the problems of application interruption and the like can be caused.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides an intelligent resource control system and method of kubernets.
According to the intelligent resource control system and method of kubernets provided by the invention, the scheme is as follows:
in a first aspect, there is provided a kubernets intelligent resource control system, the system comprising:
resource pre-check service: before the Pod is scheduled, calculating an appropriate value by combining a corresponding trend CRD settlement result and the original Request resource setting, setting the appropriate value to a Container in the Pod, and finishing the resource setting of the Pod;
resource computing service: using the collected resource usage within the Container time window, using autopilot; a workload scaling algorithm is used for completing the calculation of the resource trend of the next time window of the Container;
resource control service: the resource control service determines a key decision maker for adjusting the Container resource in the Pod in a dispersing or dynamic updating mode;
resource dynamic update service: and realizing the key service for dynamically updating the Container resource in the Pod.
Preferably, the resource preview service includes:
the mutagenesis Webhook unit: the system is responsible for registering and observing the creation, updating and deleting the MutatingAdmission configuration of the Pod to the kubernets;
a Patch unit: the method is used for providing CRD and Pod objects and completing resource setting of a Container in Pod in a Patch mode;
a recommendation unit: an appropriate resource request and limit value is calculated based on the configuration in the CRD and the limirrange.
Preferably, the resource computing service includes:
a collecting unit: collecting resources consumed by a Container in the Pod through Prometheus;
an algorithm unit: calculating a histogram of the resource of the Container in the Pod for predicting the consumption of the resource of the Container in the next time unit Pod;
an update unit: the configuration in the CRD is updated using the data provided by the algorithm unit.
Preferably, the resource control service includes:
a storage unit: the system is responsible for acquisition of Pod and CRD, filtering of abnormal Pod and structured storage;
an eviction unit: a Pod responsible for handling evictions;
a dynamic update unit: responsible for handling dynamically updated Pod;
the main control unit: and the updating mode of the Pod is determined.
Preferably, the resource dynamic update service includes:
a DBus unit: responsible for providing commands to interact with the DBus;
a file unit: the interface is responsible for providing an interaction with the cgroup file system;
a searching unit: the system Unit configuration of the Container responsible for searching the Pod to be processed;
a management unit: according to the acquired resource data, Unit configuration is obtained through a searching Unit and is transmitted to a DBus Unit to finish cgroup modification.
On the other hand, the intelligent resource control method of kubernets is also provided, and the method comprises the following steps:
step 1: modifying the Resources field of the Pod when the Pod is created and updated through a MutatingWebhook, wherein the required value is derived from CRD Resources;
step 2: the collected data come from a Prometheus or Metrics system, a histogram is obtained according to an algorithm, and data of the next time window are predicted;
and step 3: the data of the next time window predicted by the algorithm is propagated by means of the CRD;
and 4, step 4: and finishing the CGroup modification of the Container to which the Pod belongs through Dbus communication.
Compared with the prior art, the invention has the following beneficial effects:
the invention can dynamically modify the resources of the cpu and the memory without restarting the Pod, and ensure that the container can operate according to the expected resource utilization rate without affecting the current service.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is an overall architecture diagram of the present invention;
FIG. 2 is a resource computing service submission CRD flow;
FIG. 3 is a flow of a resource control service control update;
FIG. 4 is a Pod dynamic update flow;
fig. 5 shows a resource preview process.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
An embodiment of the present invention provides an intelligent resource control system of kubernets, which is shown in fig. 1 and 2, and includes:
resource pre-check service: before the Pod is scheduled, calculating an appropriate value by combining a corresponding trend CRD settlement result and the original Request resource setting, setting the appropriate value to a Container in the Pod, and finishing the resource setting of the Pod;
resource computing service: using the collected resource usage rate in the Container time window, using autopilot; a workload scaling algorithm is used for finishing the calculation of the resource trend of the Container in the next time window;
referring to fig. 3 and 4, the resource control service: the resource control service determines a key decision maker for adjusting the Container resource in the Pod in a dispersing or dynamic updating mode;
resource dynamic update service: and realizing the key service for dynamically updating the Container resource in the Pod.
Referring to fig. 5, in particular, the resource preview service includes:
the mutagenesis Webhook unit: the system is responsible for registering and observing the creation, updating and deleting the MutatingAdmission configuration of the Pod to the kubernets;
a Patch unit: the method is used for providing CRD and Pod objects and completing resource setting of a Container in Pod in a Patch mode;
a recommendation unit: an appropriate resource request and limit value is calculated based on the configuration in the CRD and the limirrange.
The resource computing service includes:
a collecting unit: collecting resources consumed by a Container in the Pod through Prometheus;
an algorithm unit: calculating a histogram of the resource of the Container in the Pod for predicting the consumption of the resource of the Container in the next time unit Pod;
an update unit: the configuration in the CRD is updated using the data provided by the algorithm unit.
The resource control service includes:
a storage unit: the system is responsible for acquisition of Pod and CRD, filtering of abnormal Pod and structured storage;
an eviction unit: a Pod responsible for handling evictions;
a dynamic update unit: responsible for handling dynamically updated Pod;
the main control unit: and the updating mode of the Pod is determined.
The resource dynamic update service comprises:
a DBus unit: responsible for providing commands to interact with the DBus;
a file unit: the interface is responsible for providing an interaction with the cgroup file system;
a searching unit: the system Unit configuration of the Container responsible for searching the Pod to be processed;
a management unit: according to the acquired resource data, Unit configuration is obtained through a searching Unit and is transmitted to a DBus Unit to finish cgroup modification.
The invention also provides an intelligent resource control method of kubernets, which comprises the following steps:
step 1: modifying the Resources field of the Pod when the Pod is created and updated through a MutatingWebhook, wherein the required value is derived from CRD Resources;
step 2: the collected data come from a Prometheus or Metrics system, a histogram is obtained according to an algorithm, and data of the next time window are predicted;
and step 3: the data of the next time window predicted by the algorithm is propagated by means of the CRD;
and 4, step 4: and finishing the CGroup modification of the Container to which the Pod belongs through Dbus communication.
Next, the present invention will be described in more detail.
Referring to fig. 1, the system specifically includes a resource preview service, a resource control service, a resource update service, and a resource calculation service. Services do not directly communicate with each other, but interaction is realized through CRD resources, and finally the purpose of dynamically stretching and retracting Pod resources is achieved.
Resource pre-check service: the resource pre-check service needs to solve the following problems: firstly, there are Pod created in kubernets, the preview service can make a hook creation request between creation, then the modified Pod is submitted to the system, secondly, the preview service can be quickly matched with the corresponding CRD information through the description information of the Pod, and the CRD stores the resource data which should be set by the Pod in the starting round. To achieve the first objective, the preview service registers a mutetgowkok configuration with kubernets when starting, and declares Create and Update operations of hook resource Pod during configuration. After the above operation, if there is a newly submitted Pod in the system, the hook flow of the preview service is triggered. When the hook flow is triggered, the preview service needs to quickly match Pod information, the preview service sets a cache, the following binary group { selector, CRD } is stored in the cache, and the cache is synchronized in real time and keeps consistent with data in kubernets. By matching the binary group, the CRD resource can be quickly searched to obtain the CRD resource, and the preset value of the resource in the CRD resource is read and then set in the tag of the Pod resource application. The above is the core flow of the preview service. The core data is the Pod to be created and the resource CRD required for recording the startup round.
Resource computing service: the computing service is a producer of manufacturing CRD resources. The service needs to realize trend calculation of resource consumption of Pod and notify other services of the calculation result. The method comprises the steps that firstly, computing service obtains real-time resource consumption of Pod through a prometheus system, then the real-time resource consumption of the Pod is stored in a telescopic window algorithm, when the Pod consumption resource is computed according to the algorithm and is possibly required to be expanded, the computing service matches a CRD which is already established through a binary group, and the CRD is updated by submitting an updating request to the system. If the doublet fails to match the CRD, a request to create a CRD resource is submitted and the calculated value is stored.
Resource control service: the control service is used to determine whether the Pod is a cold start or a hot update. Firstly, the service is controlled to traverse all CRD resources at regular time, and all Pods in operation are obtained at the same time. And reading the current consumed resource of the Pod through the { selector, Pod } binary quick resume matching relation, obtaining the recommended resource through the CRD, comparing whether the recommended resource and the current consumed resource are in a protection range, if so, not updating the Pod, and if so, entering an updating process. The purpose of the protection range, i.e. the redundancy range, is set here to avoid frequent updates of Pod. After entering an updating process, the control service is firstly matched with a node where the Pod is located, then whether reserved resources of the node can meet the capacity expansion requirement of the Pod is calculated, if the reserved resources of the node can meet the capacity expansion requirement of the Pod, the resource dynamic updating service is started, and Pod and CRD information is transmitted to the resource dynamic updating service; if the resources are not satisfied, whether the Pod allows eviction is judged, and the rebuilding of the Pod is triggered through an eviction operation, so that the resource pre-checking service is triggered. The above is the main function of the resource control service. It triggers a dynamic update service or a resource preview service according to the contents of the CRD and the POD.
Resource dynamic update service: the dynamic resource updating service is responsible for completing the modification of the Systemd unit configuration of the Pod, and the purpose of modifying the resource limit of the Pod without stopping is achieved. First, after the resource dynamic update service is started, the resource control service transmits a CRD and Pod information to be updated. The corresponding systemduinit or cgroup position is retrieved through dockerID information of Pod. And then reading the resource presetting in the CRD, modifying the searched cgroup configuration in a dbus or file system mode, reporting events to kubernetes api after the modification is finished, and finishing the resource dynamic updating process.
The embodiment of the invention provides an intelligent resource control system and method of kubernets, which can dynamically modify Pod resources under the condition of not restarting Pod and ensure that a container can operate according to expected resource utilization rate under the condition of not influencing current services.
Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, units provided by the present invention as pure computer readable program code, the system and its various devices, modules, units provided by the present invention can be fully implemented by logically programming method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices, modules and units thereof provided by the invention can be regarded as a hardware component, and the devices, modules and units included in the system for realizing various functions can also be regarded as structures in the hardware component; means, modules, units for performing the various functions may also be regarded as structures within both software modules and hardware components for performing the method.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (6)

1. An intelligent resource control system of kubernets, comprising:
resource pre-check service: before the Pod is scheduled, calculating an appropriate value by combining a corresponding trend CRD settlement result and the original Request resource setting, setting the appropriate value to a Container in the Pod, and finishing the resource setting of the Pod;
resource computing service: using the collected resource usage within the Container time window, using autopilot; a workload scaling algorithm is used for completing the calculation of the resource trend of the next time window of the Container;
resource control service: the resource control service determines a key decision maker for adjusting the Container resource in the Pod in a dispersing or dynamic updating mode;
resource dynamic update service: and realizing the key service for dynamically updating the Container resource in the Pod.
2. The intelligent resource control system of kubernets of claim 1, wherein the resource preview service includes:
the mutagenesis Webhook unit: the system is responsible for registering and observing the creation, updating and deleting the MutatingAdmission configuration of the Pod to the kubernets;
a Patch unit: the method is used for providing CRD and Pod objects and completing resource setting of a Container in Pod in a Patch mode;
a recommendation unit: an appropriate resource request and limit value is calculated based on the configuration in the CRD and the limirrange.
3. The intelligent resource control system of kubernets of claim 1, wherein the resource computing services include:
a collecting unit: collecting resources consumed by a Container in the Pod through Prometheus;
an algorithm unit: calculating a histogram of the resource of the Container in the Pod for predicting the consumption of the resource of the Container in the next time unit Pod;
an update unit: the configuration in the CRD is updated using the data provided by the algorithm unit.
4. The intelligent resource control system of kubernets of claim 1, wherein the resource control service includes:
a storage unit: the system is responsible for acquisition of Pod and CRD, filtering of abnormal Pod and structured storage;
an eviction unit: a Pod responsible for handling evictions;
a dynamic update unit: responsible for handling dynamically updated Pod;
the main control unit: and the updating mode of the Pod is determined.
5. The intelligent resource control system of kubernets of claim 1, wherein the resource dynamic update service comprises:
a DBus unit: responsible for providing commands to interact with the DBus;
a file unit: the interface is responsible for providing an interaction with the cgroup file system;
a searching unit: the system Unit configuration of the Container responsible for searching the Pod to be processed;
a management unit: according to the acquired resource data, Unit configuration is obtained through a searching Unit and is transmitted to a DBus Unit to finish cgroup modification.
6. An intelligent resource control method of kubernets is characterized by comprising the following steps:
step 1: modifying the Resources field of the Pod when the Pod is created and updated through a MutatingWebhook, wherein the required value is derived from CRD Resources;
step 2: the collected data come from a Prometheus or Metrics system, a histogram is obtained according to an algorithm, and data of the next time window are predicted;
and step 3: the data of the next time window predicted by the algorithm is propagated by means of the CRD;
and 4, step 4: and finishing the CGroup modification of the Container to which the Pod belongs through Dbus communication.
CN202111495503.7A 2021-12-08 2021-12-08 Intelligent resource control system and method for kubernets Pending CN114138421A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111495503.7A CN114138421A (en) 2021-12-08 2021-12-08 Intelligent resource control system and method for kubernets

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111495503.7A CN114138421A (en) 2021-12-08 2021-12-08 Intelligent resource control system and method for kubernets

Publications (1)

Publication Number Publication Date
CN114138421A true CN114138421A (en) 2022-03-04

Family

ID=80385378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111495503.7A Pending CN114138421A (en) 2021-12-08 2021-12-08 Intelligent resource control system and method for kubernets

Country Status (1)

Country Link
CN (1) CN114138421A (en)

Similar Documents

Publication Publication Date Title
US11507430B2 (en) Accelerated resource allocation techniques
CN109831500B (en) Synchronization method for configuration file and Pod in Kubernetes cluster
CN105049268B (en) Distributed computing resource distribution system and task processing method
US9489443B1 (en) Scheduling of splits and moves of database partitions
EP2932370B1 (en) System and method for performing a transaction in a massively parallel processing database
US8112771B2 (en) Managing component programs within a service application
US6553369B1 (en) Approach for performing administrative functions in information systems
Ailijiang et al. WPaxos: Wide area network flexible consensus
CN106936623A (en) The management method of distributed cache system and cache cluster
CN108833503A (en) A kind of Redis cluster method based on ZooKeeper
CN111552483B (en) Cloud service deployment method, device, equipment and medium
CA3137748C (en) Method and apparatus for determining configuration knob of database
CN109639773A (en) A kind of the distributed data cluster control system and its method of dynamic construction
US9959301B2 (en) Distributing and processing streams over one or more networks for on-the-fly schema evolution
CN109067562A (en) Dynamic configuration update method and system, server and medium based on intelligent pointer
CN105824660A (en) Application program updating method and terminal
CN104410511A (en) Server management method and system
CN114138421A (en) Intelligent resource control system and method for kubernets
CN112711564B (en) Merging processing method and related equipment
CN105610621B (en) A kind of method and device of distributed system architecture task level dynamic state of parameters adjustment
CN103596203A (en) Local self-maintenance wireless sensor network energy-saving clustering topology control method
CN112905306A (en) Multi-cluster container management method and device, electronic equipment and storage medium
EP4323881A1 (en) Geographically dispersed hybrid cloud cluster
CN113472649B (en) Wireless sensing node management method, electronic device and computer readable storage medium
CN115470303B (en) Database access method, device, system, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination