CN111399986A - Method and device for configuring Pod resource quota - Google Patents

Method and device for configuring Pod resource quota Download PDF

Info

Publication number
CN111399986A
CN111399986A CN202010210783.1A CN202010210783A CN111399986A CN 111399986 A CN111399986 A CN 111399986A CN 202010210783 A CN202010210783 A CN 202010210783A CN 111399986 A CN111399986 A CN 111399986A
Authority
CN
China
Prior art keywords
resource
data
pod
quota
resource quota
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
CN202010210783.1A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010210783.1A priority Critical patent/CN111399986A/en
Publication of CN111399986A publication Critical patent/CN111399986A/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/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a device for configuring Pod resource quota, relating to the technical field of container arrangement, wherein the method comprises the following steps: acquiring initial resource quota data and resource use trend data of Pod; and if the resource use trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result. The invention can dynamically configure the resource quota data of the Pod, so that the resource quota data of the Pod is closer to the actual occupied data, the resource utilization rate of the cluster is greatly improved, and the waste of resources is reduced.

Description

Method and device for configuring Pod resource quota
Technical Field
The invention relates to the technical field of container arrangement, in particular to a method and a device for configuring Pod resource quotas.
Background
Kubernets is a container orchestration engine that supports automated deployment, large-scale scalable, application containerization management. Pod is the smallest and simplest unit in Kubernetes that can be created and deployed. Pod represents a process running in the cluster. Therefore, management of resource quotas is ultimately implemented on management of computing resources of the Pod. The computing resource management of Pod is mainly the management of CPU and memory. Each container in the Pod may specify a maximum value of resources that the container of CPU and memory can use and a minimum resource requirement value for the container's use. After setting these values, the kubernets scheduler will select a node for a Pod when it is created. The node has a maximum capacity per resource type: the Pod may be provided with the CPU and memory it needs. The scheduler will ensure that for each resource type the sum of the resource capacities of the scheduled Pod requests is less than the capacity of the node. However, in most cases, the actual resource usage of a Pod does not reach the value it declares to be used, which may result in a situation where the scheduler refuses to place a Pod on some node despite the fact that the actual memory or CPU resource usage on that node is very low, but the capacity check fails. Causing a waste of resources.
Disclosure of Invention
The invention provides a method and a device for allocating Pod resource quotas, which can dynamically adjust the resource quota allocation condition of a Pod and improve the resource utilization rate of a cluster so that the cluster can deploy more pods.
In a first aspect, an embodiment of the present invention provides a method for configuring a Pod resource quota, where the method includes: acquiring initial resource quota data and resource use trend data of Pod; and if the resource use trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result.
In a second aspect, an embodiment of the present invention further provides a Pod resource quota configuring device, where the device includes: the acquisition module is used for acquiring initial resource quota data and resource use trend data of the Pod; and the configuration module is used for adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result if the resource usage trend data reaches a first preset condition.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores a computer program that can run on the processor, and the processor implements the Pod resource quota configuring method when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable medium having a non-volatile program code executable by a processor, where the program code causes the processor to execute the above Pod resource quota configuring method.
The embodiment of the invention has the following beneficial effects: the embodiment of the invention provides a Pod resource quota configuration scheme, which comprises the steps of firstly obtaining initial resource quota data and resource use trend data of a Pod, judging the occupation trend condition of the initial resource quota data of the Pod according to the resource use trend data, and if the resource use trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result. The embodiment of the invention can dynamically configure the resource quota data of the Pod, so that the resource quota data of the Pod is closer to the actual occupied data, the resource utilization rate of the cluster is greatly improved, and the waste of resources is reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a Pod resource quota configuration method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a Pod level capacity expansion principle according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a conventional resource quota configuration principle provided in an embodiment of the present invention;
fig. 4 is a schematic diagram of a resource quota configuration principle provided in an embodiment of the present invention;
fig. 5 is a block diagram of a configuration apparatus for a Pod resource quota according to an embodiment of the present invention;
fig. 6 is a block diagram of another configuration apparatus for Pod resource quota according to an embodiment of the present invention;
fig. 7 is a block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Kubernets is an open-source container scheduling platform across host clusters that can automate deployment, expansion, and operation of application containers, providing a container-centric infrastructure.
Most fundamentally, kubernets can schedule and run application containers on a cluster of physical or virtual machines. In addition, kubernets allow developers to "break away" from physical and virtual machines, moving from a host-centric infrastructure to a container-centric infrastructure, which can provide all of the advantages and benefits inherent in containers. kubernets provide the infrastructure to build a truly container-centric development environment.
The traditional way of deploying an application program is to install application dependencies on a host computer by using a package manager of an operating system, and then install the application program. This undoubtedly tightly couples the executable files of the application, the configuration of the application, the application dependent libraries, and the lifecycle of the application with the host operating system. In this situation, predictable release and rollback can be realized through constructing an unchangeable virtual machine image version and the image version, but the virtual machine is actually too heavy, and the image is too bulky and is poor in convenience.
The new approach is to deploy containers based on operating system level virtualization rather than hardware level virtualization approaches. The containers are isolated from each other and from the host: they have their own file systems, cannot see each other's processes, and the computational resources they use can be limited. They are easier to build than virtual machines and because they are isolated from the underlying infrastructure and host file systems, they can be quickly distributed across clouds and operating systems.
Because the containers are small and start quickly, one application can be packaged in each container image. This one-to-one application mirroring relationship has many benefits. With the container, no binding with the external infrastructure environment is required, since each application does not need to be dependent on the external infrastructure environment, much less. The problem of consistency from development to production environment is perfectly solved.
The container is also more transparent than the virtual machine, which facilitates monitoring and management. Especially if the lifecycle of the container process is managed by the infrastructure, rather than being hidden from the outside by processes within the container. Finally, each application is encapsulated with a container, and managing container deployment is equivalent to managing application deployment.
In kubernets, Pod provides composite applications and maintains a container model that applies one container.
When the resource utilization rate of the application usually has high peaks and low valleys, how to carry out peak clipping and valley filling is realized, the overall resource utilization rate of the cluster is improved, and the method has a research value.
Referring to fig. 2, a schematic diagram of the Pod level expansion principle, the Pod level may be automatically scaled by a Horizontal Pod Adapter (HPA) of Kubernetes. The Horizontal Pod Autoscaler in Kubernets solves the automatic capacity expansion problem of Pod, and the current Horizontal Pod Autoscaler in the V1 version only supports CPU indexes.
Traditionally, elastic scalability will support at least two metrics, CPU and memory. However, the memory is not a very good elastic expansion judgment condition, and the memory cannot be rapidly recycled due to the fact that the HPA ejects a new container in many memory type applications. Because the memory of many applications is managed by a Virtual Machine (VM) at a language level, the memory recovery is determined by a GC (Garbage Collection) of the VM. This is likely because the difference in GC time causes the HPA to oscillate at an inappropriate point in time.
In addition, when a plurality of teams or users share the same cluster, resource competition is inevitable, and at this time, the resource usage quotas of different teams or users need to be limited. Resource quotas are tools that help administrators solve this problem.
The resource quota, defined by a ResourceQuota object, provides a limit on the total amount of resource consumption per namespace. It may limit the number of objects that can be created under namespace by type, or may limit the total amount of computing resources that can be consumed by the project in the form of resources.
The resource quota solves the problem of resource competition when a plurality of tenants share the same cluster, but does not solve the problem of resource competition under the same tenant. To solve this problem, it is necessary to perform resource management on the Pod.
Based on this, the method and the device for configuring the Pod resource quota provided by the embodiment of the invention can greatly improve the resource utilization rate of the cluster, the resource quota set by the Pod is not much different from the actual usage amount of the Pod, and the cluster can deploy more pods.
To facilitate understanding of the embodiment, a method for configuring a Pod resource quota disclosed in the embodiment of the present invention is first described in detail.
An embodiment of the present invention provides a method for configuring a Pod resource quota, referring to a flowchart of a method for configuring a Pod resource quota shown in fig. 1, where the method includes the following steps:
step S102, acquiring initial resource quota data and resource use trend data of the Pod.
In the embodiment of the present invention, initial resource quota data of a plurality of Pod in a cluster is obtained, each Pod corresponds to a group of initial resource quota data, and the initial resource quota data may be configured in advance according to experience. The resource use trend data refers to resource occupation situation data of each Pod corresponding to a plurality of time lengths or a plurality of moments in the future.
And step S104, if the resource use trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result.
In the embodiment of the present invention, it is determined whether the increase of the resource usage trend data exceeds the initial resource quota data according to a first preset condition, or whether the occupancy ratio of the resource usage trend data in the initial resource quota data is too low at a next time or within a next duration, after a determination result is obtained, a value of the initial resource quota data is increased or decreased based on the determination result and a preset configuration rule, and the adjusted resource quota data is used as a Pod resource quota configuration result.
It should be noted that the preset configuration rule may be used to determine an increase value or a decrease value of the initial resource quota data according to a difference between the resource usage trend data and the initial resource quota data.
It should be further noted that, in the embodiment of the present invention, the configuration result of the Pod resource quota may be dynamically adjusted, so as to ensure that the difference between the resource quota set by the Pod and the actual usage amount thereof is not large, and the cluster can deploy more pods.
The embodiment of the invention provides a Pod resource quota configuration scheme, which comprises the steps of firstly obtaining initial resource quota data and resource use trend data of a Pod, judging the occupation trend condition of the initial resource quota data of the Pod according to the resource use trend data, and if the resource use trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result. The embodiment of the invention can dynamically configure the resource quota data of the Pod, so that the resource quota data of the Pod is closer to the actual occupied data, the resource utilization rate of the cluster is greatly improved, and the waste of resources is reduced.
In consideration of the fact that in order to improve the index of the rich resource quota and improve the accuracy of the resource usage trend data, before the initial resource quota data and the resource usage trend data of the Pod are acquired, the following steps may be further performed:
(1) generating initial resource quota data for the Pod; the initial resource quota data of the Pod includes at least CPU quota data, memory quota data, and target quota data.
In the embodiment of the present invention, the CPU quota data is used to describe the initial resource allocated to the CPU, the memory quota data is used to describe the initial resource allocated to the memory, and the target quota data is used to describe the initial resource allocated to the target project, where the target project may be obtained by customization, and the target project may be set according to actual requirements.
It should be noted that each container in the Pod may specify a maximum value (limit) of resources that can be used by the CPU and the memory container and a minimum resource requirement value (request) used by the container, and the initial resource quota data of the Pod may be generated according to the limit and the request values. The minimum resource requirement of the container is used as the judgment dependence of the resource allocation during the container scheduling. The container is allowed to be scheduled to the node only if the amount of resources available on the current node > request. The request parameter does not limit the maximum available resources of the container. The maximum value of the resources which can be used by the container is set to 0, which means that the used resources are not limited and can be used infinitely.
(2) And acquiring historical monitoring data of the Pod, and generating resource use trend data according to the historical monitoring data and the target model.
In the embodiment of the invention, the historical monitoring data can be obtained by pulling from the test environment, and the resource use trend data is obtained by predicting according to the historical monitoring data and the target model. The target model can be a model with a time series prediction function. The specifically selected model may be determined according to actual requirements, which is not specifically limited in the embodiment of the present invention.
It should be noted that the time series prediction method is actually a regression prediction method, belongs to quantitative prediction, and has the following basic principle: on one hand, the continuity of the development of the object is admitted, and the development trend of the object is estimated by using the past time sequence data to carry out statistical analysis; on the other hand, randomness caused by accidental factors is fully considered, and in order to eliminate the influence caused by random fluctuation, statistical analysis is carried out by using historical data, and the data is appropriately processed to carry out trend prediction.
Considering that resource usage trend data is generated according to the historical monitoring data and the target model in order to optimize the prediction result of the resource usage trend data, the method can be implemented as the following steps:
determining a difference integration moving average autoregressive model according to historical monitoring data; and generating time series data according to the difference integration moving average autoregressive model, and taking the time series data as resource use trend data.
In the embodiment of the present invention, historical resource quota monitoring data pulled from a test environment may be converted into time series data using an ARIMA model (differential Integrated moving average Autoregressive model).
Considering that there may be a case where the resource quota set by the Pod is significantly different from the actual usage amount thereof, in order to reasonably utilize the resource quota set by the Pod and reduce the waste of resources, if the resource usage trend data reaches the first preset condition, the initial resource quota data is adjusted according to the preset configuration rule to obtain a Pod resource quota configuration result, which may be performed according to the following steps:
generating a resource trend utilization rate according to the initial resource quota data and the resource usage trend data; if the value of the resource utilization rate trend is smaller than a first preset threshold value in the next time period, determining that the resource utilization rate trend data reaches a first preset condition; and reducing the value of the initial resource quota data according to a preset configuration rule to obtain a resource quota configuration result.
In the embodiment of the present invention, the ratio of the resource usage trend data in the initial resource quota data at the same or corresponding time is the resource trend usage rate. If the value of the resource utilization rate trend is smaller than or equal to the first preset threshold value in the next time, the fact that the resource utilization rate is low is proved, the initial resource quota data is high, the value of the initial resource quota data can be reduced according to the preset configuration rule, and therefore the difference between the resource quota set by the Pod and the actual utilization amount of the Pod is relieved.
It should be noted that the value of the resource usage trend in the next duration may be a value of the resource usage trend at a certain characteristic time in the next duration, or may be a value obtained by calculating values of the resource usage trends at multiple times in the next duration, for example, may be an average value of the values of the resource usage trends at multiple times. The first preset threshold may be set according to experience or actual requirements, which is not specifically specified in the embodiment of the present invention.
Considering that there may be a case where a resource quota set by a Pod and an actual usage amount thereof are small, in order to ensure continuity of operation, it is necessary to ensure that the Pod has sufficient resources, and therefore, if the resource usage trend data reaches a first preset condition, the initial resource quota data is adjusted according to a preset configuration rule to obtain a Pod resource quota configuration result, which may be performed according to the following steps:
if the resource usage trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result, wherein the method comprises the following steps: generating a resource trend utilization rate according to the initial resource quota data and the resource usage trend data; if the value of the resource utilization rate trend is larger than a second preset threshold value in the next time period, determining that the resource utilization rate trend data reaches a first preset condition; and increasing the value of the initial resource quota data according to a preset configuration rule to obtain a resource quota configuration result.
In the embodiment of the present invention, the ratio of the resource usage trend data in the initial resource quota data at the same or corresponding time is the resource trend usage rate. If the value of the resource utilization rate trend is larger than or equal to a second preset threshold value in the next time, the fact that the resource utilization rate is high and the initial resource quota data is low is proved, the value of the initial resource quota data can be increased according to a preset configuration rule, and therefore the situation that the resource quota set by the Pod is insufficient is relieved.
It should be noted that the second preset threshold may be set according to experience or actual requirements, which is not specifically specified in the embodiment of the present invention.
After the resource quota set by the Pod is optimized longitudinally and the Pod resource quota configuration result is obtained, the number of instances of the Pod can be increased or decreased, and therefore the following steps can be executed:
acquiring resource use condition data of the Pod through a container monitor; generating a resource utilization rate according to the resource use condition data and the Pod resource quota configuration result; and performing automatic Pod level scaling according to the value of the resource utilization rate.
In the embodiment of the invention, the resource use condition data of the Pod is used for describing the resource occupation condition of a plurality of Pod instances, the common use condition of the plurality of Pod instances is generated according to the resource use condition data and the Pod resource quota configuration result, if the number of the existing Pod instances cannot meet the requirement, the number of the Pod instances is increased according to the value of the resource use rate, and if the overall use rate of the number of the existing Pod instances is lower, the number of the Pod instances is proved to be more, the number of the Pod instances can be reduced, and the Pod level automatic telescopic processing is realized.
Referring to the schematic diagram of the conventional resource quota configuration principle shown in fig. 3, the work flow of the Controller (Controller) is as follows:
(1) an API (Application Programming Interface) service that sends an object spec definition (Pod, Deployment, etc.) to a Kubernetes master node through a command line tool (Kubectl command);
(2) a Master node (Master node) schedules an object spec to run;
(3) once the object runs, the Controller will continue to examine the object and reconcile the actual situation against spec.
Referring to the schematic diagram of the resource quota configuration shown in fig. 4, an implementation of the present solution is described below with a specific embodiment.
The present invention may be implemented by creating custom controllers. The custom controller is realized by operator.
The Operator defines the Custom Controller by extending kubernets, observes the application and executes the Custom task according to the actual state. The application is defined as a kubernets object: custom Resource (CR), which contains yamlspec and the object type accepted by the API service (K8s kind). In this way, any particular condition to be observed can be defined in the custom specification and the instance reconciled when the instance does not match the specification. While the Operator controller primarily uses custom components, it coordinates much in a similar manner to the native kubernets controller.
To create a custom Operator, the following resources are required:
custom Resource (CR) spec, defining the application objects to be observed, and the API defined for CR;
custom Controller to observe CR;
the Custom code determines how the Custom Controller coordinates CR;
operator, managing the Custom Controller;
deployment, define Operator and custom resources.
The user-defined Operator needs to monitor the Prometous to acquire the resource use conditions of all the Pod, reset the resource quota of the Pod by analyzing the historical data of the Pod resource use amount, and simultaneously optimize the Horizontal Pod Autoscaler of the Pod to enable the elastic expansion of the Pod to be more reasonable and intelligent.
The method can be specifically realized according to the following steps:
1. creating a new operator project through a Command-line Interface (C L I) tool;
2. defining kubernets resources to be observed, and continuously monitoring events;
3. defining processing logic of operator in a specified method function, namely butting Prometheus, acquiring monitoring data of the Pod, collecting and analyzing resource usage amount of the Pod, and dynamically adjusting resource quota and instance number of the Pod;
4. and constructing a custom Operator and deploying the custom Operator on the kubernets cluster.
The embodiment of the invention provides a method and a device for configuring Pod resource quota, which can monitor the utilization of Pod resources by establishing a custom controller, and dynamically adjust the resource quota of Pod and the number of instances of Pod by comparing historical operation and maintenance data. After deployment and implementation are carried out, the resource utilization rate of the cluster is greatly improved, the difference between the resource quota set by the Pod and the actual use amount of the Pod is not large, and the cluster can deploy more pods.
An embodiment of the present invention further provides a Pod resource quota configuring device, referring to a structural block diagram of the Pod resource quota configuring device shown in fig. 5, where the device includes:
an obtaining module 51, configured to obtain initial resource quota data and resource usage trend data of a Pod; the configuration module 52 is configured to, if the resource usage trend data reaches a first preset condition, adjust the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result.
In one embodiment, the apparatus further comprises a generating module 53 for: generating initial resource quota data for the Pod; the initial resource quota data of the Pod at least comprises CPU quota data, memory quota data and target quota data; and acquiring historical monitoring data of the Pod, and generating resource use trend data according to the historical monitoring data and the target model.
In one embodiment, the generating module is specifically configured to: determining a difference integration moving average autoregressive model according to historical monitoring data; and generating time series data according to the difference integration moving average autoregressive model, and taking the time series data as resource use trend data.
In one embodiment, the configuration module is specifically configured to: generating a resource trend utilization rate according to the initial resource quota data and the resource usage trend data; if the value of the resource utilization rate trend is smaller than a first preset threshold value in the next time period, determining that the resource utilization rate trend data reaches a first preset condition; and reducing the value of the initial resource quota data according to a preset configuration rule to obtain a resource quota configuration result.
In one embodiment, the configuration module is specifically configured to: generating a resource trend utilization rate according to the initial resource quota data and the resource usage trend data; if the value of the resource utilization rate trend is larger than a second preset threshold value in the next time period, determining that the resource utilization rate trend data reaches a first preset condition; and increasing the value of the initial resource quota data according to a preset configuration rule to obtain a resource quota configuration result.
In an embodiment, referring to another structural block diagram of the Pod resource quota configuring apparatus shown in fig. 6, the apparatus further includes an optimizing module 54 configured to: acquiring resource use condition data of the Pod through a container monitor; generating a resource utilization rate according to the resource use condition data and the Pod resource quota configuration result; and performing automatic Pod level scaling according to the value of the resource utilization rate.
The embodiment of the present invention further provides a computer device, referring to the schematic block diagram of the structure of the computer device shown in fig. 7, the computer device includes a memory 71 and a processor 72, the memory stores a computer program that can be executed on the processor, and the processor implements the steps of any one of the methods when executing the computer program.
It is clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the computer device described above may refer to the corresponding process in the foregoing method embodiments, and no further description is provided herein
Embodiments of the present invention also provide a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform any of the steps of the above-described method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for configuring Pod resource quotas is characterized by comprising the following steps:
acquiring initial resource quota data and resource use trend data of Pod;
and if the resource use trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result.
2. The method of claim 1, wherein before obtaining the initial resource quota data and resource usage trend data for the Pod, further comprising:
generating initial resource quota data for the Pod; the initial resource quota data of the Pod at least comprises CPU quota data, memory quota data and target quota data;
and acquiring historical monitoring data of the Pod, and generating resource use trend data according to the historical monitoring data and a target model.
3. The method of claim 2, wherein generating resource usage trend data from the historical monitoring data and a target model comprises:
determining a difference integration moving average autoregressive model according to the historical monitoring data;
and generating time series data according to the difference integration moving average autoregressive model, and taking the time series data as resource use trend data.
4. The method of claim 1, wherein if the resource usage trend data meets a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result, comprising:
generating a resource trend utilization rate according to the initial resource quota data and the resource usage trend data;
if the value of the resource utilization rate trend is smaller than a first preset threshold value in the next time, determining that the resource utilization rate trend data reaches a first preset condition;
and reducing the value of the initial resource quota data according to a preset configuration rule to obtain a resource quota configuration result.
5. The method of claim 1, comprising: if the resource usage trend data reaches a first preset condition, adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result, including:
generating a resource trend utilization rate according to the initial resource quota data and the resource usage trend data;
if the value of the resource utilization rate trend is larger than a second preset threshold value in the next time, determining that the resource utilization rate trend data reaches a first preset condition;
and increasing the value of the initial resource quota data according to a preset configuration rule to obtain a resource quota configuration result.
6. The method according to any of claims 1-5, wherein after obtaining the Pod resource quota configuration result, further comprising:
acquiring resource use condition data of the Pod through a container monitor;
generating a resource utilization rate according to the resource usage data and the Pod resource quota configuration result;
and performing automatic Pod level scaling according to the value of the resource utilization rate.
7. A Pod resource quota configuring apparatus, comprising:
the acquisition module is used for acquiring initial resource quota data and resource use trend data of the Pod;
and the configuration module is used for adjusting the initial resource quota data according to a preset configuration rule to obtain a Pod resource quota configuration result if the resource usage trend data reaches a first preset condition.
8. The apparatus of claim 7, further comprising an optimization module to:
acquiring resource use condition data of the Pod through a container monitor;
generating a resource utilization rate according to the resource usage data and the Pod resource quota configuration result;
and performing automatic Pod level scaling according to the value of the resource utilization rate.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of any of claims 1 to 6.
CN202010210783.1A 2020-03-24 2020-03-24 Method and device for configuring Pod resource quota Pending CN111399986A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010210783.1A CN111399986A (en) 2020-03-24 2020-03-24 Method and device for configuring Pod resource quota

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010210783.1A CN111399986A (en) 2020-03-24 2020-03-24 Method and device for configuring Pod resource quota

Publications (1)

Publication Number Publication Date
CN111399986A true CN111399986A (en) 2020-07-10

Family

ID=71432838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010210783.1A Pending CN111399986A (en) 2020-03-24 2020-03-24 Method and device for configuring Pod resource quota

Country Status (1)

Country Link
CN (1) CN111399986A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112015433A (en) * 2020-08-28 2020-12-01 北京浪潮数据技术有限公司 Resource scheduling method and device, electronic equipment and storage medium
CN112199192A (en) * 2020-09-29 2021-01-08 苏州浪潮智能科技有限公司 Method and system for deploying Kubernetes cluster refined management quota based on server
CN112217858A (en) * 2020-08-28 2021-01-12 北京思特奇信息技术股份有限公司 Method and system for elastic expansion and contraction of cloud computing resources
CN112783608A (en) * 2021-01-29 2021-05-11 上海哔哩哔哩科技有限公司 Method and device for adjusting container resources in container cluster
CN113010260A (en) * 2020-09-29 2021-06-22 证通股份有限公司 Elastic expansion method and system for container quantity
CN113268310A (en) * 2021-04-12 2021-08-17 新浪网技术(中国)有限公司 Method and device for adjusting Pod resource quota, electronic equipment and storage medium
CN113849294A (en) * 2021-11-30 2021-12-28 武汉迈异信息科技有限公司 Kubernetes pod expansion and contraction system and method
CN114020479A (en) * 2022-01-06 2022-02-08 杭州银行股份有限公司 Service resource allocation method, computing device and storage medium
CN115168057A (en) * 2022-09-02 2022-10-11 浙江大华技术股份有限公司 Resource scheduling method and device based on k8s cluster
CN115248734A (en) * 2022-09-21 2022-10-28 之江实验室 Private cloud multi-tenant resource quota self-adaptive adjustment method and device
CN117170881A (en) * 2023-11-02 2023-12-05 建信金融科技有限责任公司 Resource regulation method and device, storage medium and processor

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112217858A (en) * 2020-08-28 2021-01-12 北京思特奇信息技术股份有限公司 Method and system for elastic expansion and contraction of cloud computing resources
CN112015433A (en) * 2020-08-28 2020-12-01 北京浪潮数据技术有限公司 Resource scheduling method and device, electronic equipment and storage medium
CN112199192B (en) * 2020-09-29 2022-07-22 苏州浪潮智能科技有限公司 Method and system for deploying Kubernetes cluster refined management quota based on server
CN112199192A (en) * 2020-09-29 2021-01-08 苏州浪潮智能科技有限公司 Method and system for deploying Kubernetes cluster refined management quota based on server
CN113010260A (en) * 2020-09-29 2021-06-22 证通股份有限公司 Elastic expansion method and system for container quantity
CN112783608A (en) * 2021-01-29 2021-05-11 上海哔哩哔哩科技有限公司 Method and device for adjusting container resources in container cluster
CN113268310A (en) * 2021-04-12 2021-08-17 新浪网技术(中国)有限公司 Method and device for adjusting Pod resource quota, electronic equipment and storage medium
CN113268310B (en) * 2021-04-12 2024-04-02 新浪技术(中国)有限公司 Pod resource quota adjustment method and device, electronic equipment and storage medium
CN113849294A (en) * 2021-11-30 2021-12-28 武汉迈异信息科技有限公司 Kubernetes pod expansion and contraction system and method
CN114020479A (en) * 2022-01-06 2022-02-08 杭州银行股份有限公司 Service resource allocation method, computing device and storage medium
CN115168057A (en) * 2022-09-02 2022-10-11 浙江大华技术股份有限公司 Resource scheduling method and device based on k8s cluster
CN115248734A (en) * 2022-09-21 2022-10-28 之江实验室 Private cloud multi-tenant resource quota self-adaptive adjustment method and device
CN115248734B (en) * 2022-09-21 2022-12-13 之江实验室 Private cloud multi-tenant resource quota self-adaptive adjustment method and device
CN117170881A (en) * 2023-11-02 2023-12-05 建信金融科技有限责任公司 Resource regulation method and device, storage medium and processor
CN117170881B (en) * 2023-11-02 2024-02-02 建信金融科技有限责任公司 Resource regulation method and device, storage medium and processor

Similar Documents

Publication Publication Date Title
CN111399986A (en) Method and device for configuring Pod resource quota
US8219997B2 (en) Execution the job that is divided into job tasks based on the estimated completion time
AU2014309371B2 (en) Virtual hadoop manager
CN108881495B (en) Resource allocation method, device, computer equipment and storage medium
CN109962856B (en) Resource allocation method, device and computer readable storage medium
KR101113943B1 (en) Method And Apparatus For Managing Workload And Distributed Computing System Using The Same
CN103095599A (en) Dynamic feedback weighted integration load scheduling method of cloud computing operating system
CN107851039A (en) System and method for resource management
CN111722928A (en) Resource scheduling method and device, electronic equipment and storage medium
CN104753977A (en) Seismic processing and interpretation infrastructure cloud resource scheduling method based on fuzzy clustering
CN103488538B (en) Application extension device and application extension method in cloud computing system
CN111258746A (en) Resource allocation method and service equipment
US20210406053A1 (en) Rightsizing virtual machine deployments in a cloud computing environment
CN113032102A (en) Resource rescheduling method, device, equipment and medium
CN110084507B (en) Scientific workflow scheduling optimization method based on hierarchical perception in cloud computing environment
Sfakianakis et al. Skynet: Performance-driven resource management for dynamic workloads
CN107203256B (en) Energy-saving distribution method and device under network function virtualization scene
KR20210041295A (en) Virtualized resource distribution system in cloud computing environment
CN103959276A (en) Resource allocation prioritization based on knowledge of user intent and process independence
WO2020163120A1 (en) Efficient scaling of a container-based application in a distributed computing system
Xu et al. MEER: Online estimation of optimal memory reservations for long lived containers in in-memory cluster computing
CN115480924A (en) Method and device for processing job data, storage medium and electronic equipment
CN115712487A (en) Resource scheduling method and device
CN114153604A (en) Container cluster control method and device
CN113608798A (en) Method and device for configuring resources used by non-JAVA application and cloud-native application

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
TA01 Transfer of patent application right

Effective date of registration: 20220913

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right