A service creation method, system, and electronic device for a Kubernetes system
By predicting and adjusting the computing resource usage of containers in the Kubernetes system, the problem of waste caused by unreasonable resource configuration is solved, and the convenience and ease of service creation are improved.
Patent Information
- Application Number
- CN202111643284.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In Kubernetes systems, existing technologies struggle to effectively configure reasonable computer resources, leading to resource waste during container service runtime.
By receiving service creation requests, the system predicts the computer resource usage of the target service based on the resource information of already running services, configures initial resources, and adjusts them according to actual usage to optimize container resource configuration.
It enables automated configuration of reasonable computer resources, improves the convenience and ease of use of creating services in the Kubernetes system, and reduces manual intervention.
Smart Images

Figure CN114443285B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of Internet application technology, and in particular to a service creation method, system, and electronic device for a Kubernetes system. Background Technology
[0002] Kubernetes is an orchestration tool for managing containers across multiple hosts in a cloud platform. It provides containerized deployment for applications and supports container planning, updates, and maintenance. Containers consume few resources and deploy quickly. Each application can be packaged into a container image without needing to be combined with other application stacks, which enables a consistent runtime environment from development and testing to production.
[0003] In the future, more and more internet services will migrate to containers. During this process, to ensure that containers can run normally, excessive computing resources are often configured for them, leading to waste. This necessitates professional operations and maintenance personnel to follow up, evaluate, and reconfigure the container's computing resources. It can be seen that creating container services with reasonable computing resources in Kubernetes is currently relatively cumbersome. Summary of the Invention
[0004] The purpose of this invention is to propose a service creation method, system, and electronic device for a Kubernetes system, which can intelligently configure reasonable computer resources for newly created container services.
[0005] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:
[0006] Firstly, a service creation method for Kubernetes systems is proposed, including:
[0007] Receive requests to create the target service in the Kubernetes system;
[0008] Based on the resource information of the running services related to the target service in the Kubernetes system, predict the computer resource usage of the target service;
[0009] Create a container for the target service in the Kubernetes system, and configure the container with initial computer resources based on the predicted computer resource usage.
[0010] The target service is run based on the container configured with initial computer resources, and the computer resource usage of the container is obtained.
[0011] Based on the obtained computer resource usage, the initial computer resources configured for the container are adjusted, and the adjusted container is used to run the target service.
[0012] Secondly, a Kubernetes system is proposed, including:
[0013] The receiving module is used to receive requests to create the target service in the Kubernetes system;
[0014] The prediction module is used to predict the computer resource usage of the target service based on the resource information of the running services related to the target service in the Kubernetes system.
[0015] A configuration module is used to create a container for the target service in the Kubernetes system and configure the initial computer resources for the container based on the predicted computer resource usage.
[0016] A monitoring module is used to run the target service based on the container configured with initial computer resources, and to obtain the computer resource usage of the container.
[0017] The adjustment module adjusts the initial computer resources configured for the container based on the obtained computer resource usage information, and the adjusted container is used to run the target service.
[0018] Thirdly, an electronic device is proposed, comprising: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform:
[0019] Receive requests to create the target service in the Kubernetes system;
[0020] Based on the resource information of the running services related to the target service in the Kubernetes system, predict the computer resource usage of the target service;
[0021] Create a container for the target service in the Kubernetes system, and configure the container with initial computer resources based on the predicted computer resource usage.
[0022] The target service is run based on the container configured with initial computer resources, and the computer resource usage of the container is obtained.
[0023] Based on the obtained computer resource usage, the initial computer resources configured for the container are adjusted, and the adjusted container is used to run the target service.
[0024] Fourthly, a computer-readable storage medium is proposed that stores one or more programs, which are executed by an electronic device including multiple applications:
[0025] Receive requests to create the target service in the Kubernetes system;
[0026] Based on the resource information of the running services related to the target service in the Kubernetes system, predict the computer resource usage of the target service;
[0027] Create a container for the target service in the Kubernetes system, and configure the container with initial computer resources based on the predicted computer resource usage.
[0028] The target service is run based on the container configured with initial computer resources, and the computer resource usage of the container is obtained.
[0029] Based on the obtained computer resource usage, the initial computer resources configured for the container are adjusted, and the adjusted container is used to run the target service.
[0030] The method in this application, when creating a target service in a Kubernetes system, first predicts the computer resource usage of the target service based on resource information of already running services related to the target service in the Kubernetes system, and then configures the container running the target service according to the predicted computer resource usage. Next, the target service is run on the container with the initial computer resource configuration, and the initial computer resource configuration of the container is adjusted according to the computer resource usage corresponding to the target service running in the container. This solution can automatically configure running containers with appropriate computer resources for newly created services in the Kubernetes system. Because it does not rely heavily on manual intervention, it can effectively improve the convenience and ease of use of creating services in the Kubernetes system. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1This is a schematic diagram of the first process of a service creation method for a Kubernetes system provided in an embodiment of the present invention.
[0033] Figure 2 This is a schematic diagram of a second process for a service creation method for a Kubernetes system provided in an embodiment of the present invention.
[0034] Figure 3 This is a schematic diagram of the structure of the Kubernetes system provided in an embodiment of the present invention.
[0035] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0037] Currently, when developers create container services in Kubernetes systems, it is often difficult to directly predict the appropriate computing resources for the container. However, in order to ensure the normal operation of the container service, they often configure excessive computing resources for it, resulting in a serious waste problem. To address this issue, this application aims to propose a technical solution that can intelligently configure appropriate computing resources for newly created container services.
[0038] Figure 1 This is a flowchart of a service creation method for a Kubernetes system according to an embodiment of the present invention. Figure 1 The method shown can be executed by the system described below, and specifically includes the following steps:
[0039] S102 receives a request to create a target service in the Kubernetes system.
[0040] Specifically, in this embodiment of the application, the Kubernetes system can expose the service creation function to the user client. Correspondingly, the user client can input the profile information of the service to be created, such as the service name and service type, through the user client UI interface, and package it into a request message and send it to the Kubernetes system.
[0041] S104, based on the resource information of the running services related to the target service in the Kubernetes system, predicts the computer resource usage of the target service.
[0042] Specifically, after extracting the profile information of the target service from the request, this step identifies the running services in the Kubernetes system that match the profile information of the target service, and predicts the computer resource usage of the target service based on the computer resources configured in the container corresponding to the running service. The running services related to the target service mentioned here can refer to services of the same type as the target service, or services with the same priority as the target service.
[0043] Specifically, this step can perform a weighted calculation of the computer resources configured in the container corresponding to the running service based on the ratio of the actual query rate per second of the running service to the theoretical query rate per second of the target service, so as to obtain the computer resource usage of the target service. The theoretical query rate per second of the target service is determined based on the profile information of the target service.
[0044] It should be understood that there are various algorithms for predicting the computer resource usage of a target service, and this application does not impose any specific limitations on them. However, any scheme that uses the computer resource usage of containers corresponding to other running services with similar profile information as a reference to predict the computer resource usage of the target service should fall within the scope of this application.
[0045] Of course, if no running service matching the profile information of the target service is found in the Kubernetes system, a computer resource usage can be calculated based on the profile information of the target service, such as the theoretical query rate per second, as a prediction result.
[0046] Furthermore, the final predicted computer resource usage can also be determined by the user who initiated the request. That is, this step sends the predicted computer resource usage to the user's client for recommendation and receives the user's feedback on the amount of computer resource requests made after the recommendation. Then, based on the amount of computer resource requests, the predicted computer resource usage is adjusted to finalize the predicted result.
[0047] Of course, in most cases, the amount of computer resource requests initiated by the user can be directly used as the predicted computer resource usage. Alternatively, to avoid unreasonable computer resource requests from the user, the predicted computer resource usage can be adjusted within an allowable range based on the amount of computer resource requests initiated by the user. For example, if the allowable adjustment range is set to 10%, and the amount of computer resource requests initiated by the user exceeds the previously predicted computer resource usage by 8%, then the previously predicted computer resource usage is multiplied by (100 + 8)% to obtain the final prediction result. Similarly, if the amount of computer resource requests initiated by the user exceeds the previously predicted computer resource usage by 15%, then the portion exceeding the allowable adjustment range of 5% is considered an invalid computer resource request, and the previously predicted computer resource usage is multiplied by (100 + 10)% to obtain the final prediction result.
[0048] S106 creates a container for the target service in the Kubernetes system and configures the container with initial computer resources based on the predicted computer resource usage.
[0049] It should be understood that the initial configuration only ensures that the container uses computer resources within a reasonable range, so subsequent adjustments are needed to monitor the actual operation of the container's computer resources.
[0050] S108, based on the container running the target service with initial computer resources configured, obtain the container's computer resource usage.
[0051] It should be understood that controlling the target service running in the container to obtain information about computer resource usage is for subsequent adjustments to the computer resource configuration of the container in its initial configuration.
[0052] Specifically, in this application embodiment, when the container is actually running the target service, the computer resource usage of the container can be obtained. That is, after configuring the initial computer resources of the container in S106, the container is directly started and the computer resource usage of the container is monitored.
[0053] Alternatively, instead of enabling the container until more accurate computer resources are determined, you can control the container with initial computer resources to run the target service in a simulated environment to obtain information about the container's computer resource usage.
[0054] S110, based on the obtained computer resource usage, adjusts the initial computer resources configured for the container, and the adjusted container is used to run the target service.
[0055] Specifically, embodiments of this application can configure a monitoring component for monitoring the computer resource usage of a container into the container of a target service. When the container is running the target service, the monitoring component can be automatically enabled to monitor and provide information on the container's computer resource usage.
[0056] If the container's utilization rate is high, such as exceeding the first preset threshold, it indicates that the initial computer resources configured for the container were insufficient. In this case, more computer resources can be configured for the container to support the running of the target service. If the container's utilization rate is low, such as below the second preset threshold, it indicates that the initial computer resources configured for the container were excessive. In this case, the computer resources configured for the container can be reduced to avoid waste.
[0057] Furthermore, in practical applications, if the container is actually running the target service, this step can adjust the container's computing resources online to ensure the target service's operation is unaffected. For example, for the target service, a new container with the adjusted computing resources can be created and enabled in the Kubernetes system; simultaneously, the old container with the initial computing resources can be disabled or deleted after no tasks are running. If the container is running the target service in a simulated environment, this step can adjust the container's computing resources to enable the container and run the target service in an actual environment.
[0058] The method in this application, when creating a target service in a Kubernetes system, first predicts the computer resource usage of the target service based on resource information of already running services related to the target service in the Kubernetes system, and then configures the container for running the target service according to the predicted computer resource usage. Next, the target service is run on the container with the initial computer resource configuration, and the initial computer resource configuration of the container is optimized and adjusted based on the computer resource usage corresponding to the target service running in the container. This solution can automatically configure running containers with reasonable computer resources for newly created services in the Kubernetes system. Because it does not rely heavily on manual intervention, it can effectively improve the convenience and ease of use of creating services in the Kubernetes system.
[0059] The following section describes the process of the method in the embodiments of this application, focusing on the Kubernetes system and practical application scenarios.
[0060] like Figure 2 As shown, the components in the Kubernetes system of this application embodiment include:
[0061] 1) User UI components:
[0062] This component allows users to request service creation from the Kubernetes system via a browser client. The UI provides options for creating service containers, such as: service name, service type (web service, database service, TCP service, etc.), and the service's theoretical requests per second (QPS) profile information.
[0063] like Figure 2 As shown in step 1, after the user fills in the data on the UI interface, it submits it to the cost recommendation component, which then recommends the CPU and memory allocation data for the business requested by the user.
[0064] 2) Recommended cost components:
[0065] like Figure 2 As shown in step 2, after receiving the service creation request submitted by the user through the UI, the cost recommendation component submits the request to the service profiling subsystem in the Kubernetes system to retrieve the following information:
[0066] ① Has a container for the same type of service been created before?
[0067] ② When creating similar services in the past, what were the recommended CPU and memory requirements for the container?
[0068] ③ When the same type of service is currently running, how much CPU and memory does the container use?
[0069] Next, the cost recommendation component compares the QPS of the newly created service with the QPS ratio of previously created similar services, predicts the CPU and memory requirements of the new service, and feeds this prediction back to the cost recommendation component. The prediction strategy primarily focuses on QPS; the recommended value is a similar service that is already running and has a reasonable CPU and memory configuration. Therefore, based on the current QPS / CPU and QPS / Memory ratios of this similar service, a ratio is obtained, multiplied by the required QPS of the new service, to arrive at the recommended CPU and memory requirements. If there are multiple similar services, multiple recommendations are obtained using the same method, and the average of these recommendations is taken to obtain the final adopted recommendation.
[0070] Subsequently, the cost recommendation component sends a container creation request to the container creation and modification interface component based on the predicted CPU and memory usage of the new service container.
[0071] 3) Container creation and modification interface components
[0072] like Figure 2As shown in step 3, after receiving the container creation request submitted by the cost recommendation system, the container creation and modification interface component extracts the following information from the request: business name, memory allocation, CPU allocation, etc.
[0073] After that, as Figure 2 As shown in step 4, the container creation and modification interface component compiles and submits information such as business name, memory allocation, and CPU allocation to the container platform interface component.
[0074] 4) Container platform interface components
[0075] like Figure 2 As shown in step 5, the container platform interface connects to the container orchestration and management component K8S, and the compiled information is further submitted to the container creation component through K8S.
[0076] 5) Container creation component
[0077] The container creation component begins by creating containers for new services, setting the maximum amount of CPU and memory that the containers can use.
[0078] In addition, the container creation component monitors the container's running status at regular intervals, obtains the amount of CPU and memory used, and submits it to the container monitoring and data collection component.
[0079] 6) Container monitoring and data collection components
[0080] like Figure 2 As shown in step 6, the container monitoring and data collection component receives the container CPU and memory usage data submitted by the container creation component and notifies the container creation component.
[0081] 7) Container runtime analysis component
[0082] like Figure 2 As shown in step 7, the container monitoring and data collection component submits the container's CPU and memory usage to the container runtime analysis subsystem.
[0083] like Figure 2 As shown in step 8, the container runtime analysis subsystem obtains the profile information of the new service (the recommended CPU and memory usage at the time of initial creation) from the service profile subsystem, and combines it with the CPU and memory usage of the container when the new service is currently running to determine whether the amount of CPU and memory of the container needs to be adjusted.
[0084] If adjustments are needed, then... Figure 2 As shown in step 9, the submission is made to the container creation and modification interface, and then... Figure 2 Steps 4, 5, and 6 form a loop.
[0085] In summary, the Kubernetes system in this application scenario can provide a reasonable recommended number of CPUs and memory for newly created services. It creates new service containers based on this initial recommendation, and after the new service is running, it monitors the actual CPU and memory usage and then readjusts the CPU and memory configurations for the containers. Therefore, it has the following advantages:
[0086] 1. Developers can deploy services on the Kubernetes system with a single click through the UI interface. They can rely on the recommended configuration of container computer resources provided by the Kubernetes system without having to conduct their own assessments.
[0087] 2. It supports automatic configuration of containers for running services. Based on the actual CPU and memory usage of the container, it dynamically adjusts the amount of CPU and memory configured in the container, eliminating the need for maintenance personnel to manually follow up and debug in the future.
[0088] The above application scenarios are exemplary descriptions of the methods in the embodiments of this application. Appropriate changes can be made without departing from the principles described above, and these changes should also fall within the scope of protection of this application.
[0089] Figure 3 This is a structural diagram of a Kubernetes system 300 according to an embodiment of this application, including:
[0090] The receiving module 310 is used to receive requests to create a target service in the Kubernetes system.
[0091] The prediction module 320 is used to predict the computer resource usage of the target service based on the resource information of the running services related to the target service in the Kubernetes system.
[0092] Configuration module 330 is used to create a container for the target service in the Kubernetes system and configure initial computer resources for the container based on the predicted computer resource usage.
[0093] The monitoring module 340 is used to run the target service based on the container configured with initial computer resources and obtain the computer resource usage of the container.
[0094] The adjustment module 350 adjusts the initial computer resources configured for the container based on the obtained computer resource usage information. The adjusted container is then used to run the target service.
[0095] In this application's embodiment of the Kubernetes system, when creating a target service, the system first predicts the computer resource usage of the target service based on resource information of already running services related to the target service in the Kubernetes system. Then, it configures containers to run the target service according to the predicted initial computer resource usage. Next, it runs the target service based on the containers configured with the initial computer resources. Finally, it optimizes and adjusts the initial computer resource configuration of the containers based on the computer resource usage corresponding to the target service running in the containers. This solution can automatically configure running containers with appropriate computer resources for newly created services in the Kubernetes system. Because it does not rely heavily on manual intervention, it can effectively improve the convenience and ease of use of creating services in the Kubernetes system.
[0096] Optionally, the prediction module 320 runs the target service based on the container configured with initial computer resources and obtains the computer resource usage of the container, including: before the container is enabled, controlling the container configured with initial computer resources to run the target service in a simulated environment and obtaining the computer resource usage of the container; then, the adjustment module 350 adjusts the initial computer resources configured for the container based on the obtained computer resource usage and sets the container with adjusted computer resources to the enabled state.
[0097] Optionally, the request carries profile information of the target service; the prediction module 320 predicts the computer resource usage of the target service based on the resource information of the running services related to the target service in the Kubernetes system, including: determining the running services that match the profile information of the target service from the Kubernetes system; and predicting the computer resource usage of the target service based on the computer resources configured in the containers corresponding to the running services.
[0098] Optionally, the prediction module 320 predicts the computer resource usage of the target service based on the computer resources configured in the container corresponding to the running service. Specifically, this includes: weighting the computer resources configured in the container corresponding to the running service based on the ratio of the actual query rate per second of the running service to the theoretical query rate per second of the target service, to obtain the computer resource usage of the target service. The theoretical query rate per second of the target service is determined based on the profile information of the target service.
[0099] Optionally, before the monitoring module 340 runs the target service based on the container configured with initial computer resources and obtains the computer resource usage of the container, the configuration module 330 is further configured to configure a monitoring component for monitoring the computer resource usage of the container into the container; wherein, when the container runs the target service, the monitoring component is enabled to provide the computer resource usage of the container.
[0100] Optionally, the configuration module 330 is specifically used to send the predicted computer resource usage to the user terminal for recommendation; and to receive the computer resource request amount fed back by the user terminal after recommendation, and to adjust the predicted computer resource usage based on the computer resource request amount, and to configure the container with the initial computer resources using the adjusted computer resource usage.
[0101] The aforementioned user terminal may include, but is not limited to, a UI user terminal.
[0102] Obviously, the Kubernetes system described in the embodiments of this specification can be used as... Figure 1 and Figure 2 The execution body of the method shown can therefore be implemented in... Figure 1 and Figure 2 The steps and corresponding functions are shown below. Since the principle is the same, they will not be described in detail here.
[0103] Figure 4 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0104] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0105] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0106] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming the Kubernetes system at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0107] Receives requests to create the target service in the Kubernetes system.
[0108] Based on the resource information of the running services related to the target service in the Kubernetes system, the computer resource usage of the target service is predicted.
[0109] A container for the target service is created in the Kubernetes system, and initial computer resources are configured for the container based on the predicted computer resource usage.
[0110] The target service is run based on the container configured with initial computer resources, and the computer resource usage of the container is obtained.
[0111] Based on the obtained computer resource usage, the initial computer resources configured for the container are adjusted, and the adjusted container is used to run the target service.
[0112] The above is as described in this instruction manual. Figure 1The methods disclosed in the illustrated embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0113] It should be understood that the electronic devices described in the embodiments of this specification can achieve... Figure 1 and Figure 2 The illustrated embodiments demonstrate the functionality of the same principle, which will not be repeated here.
[0114] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0115] Furthermore, embodiments of this specification also propose a computer-readable storage medium that stores one or more programs, the one or more programs including instructions.
[0116] When the aforementioned instruction is executed by a portable electronic device that includes multiple applications, it enables the portable electronic device to perform... Figure 1 The method in the illustrated embodiment is specifically used to execute the steps performed by the member object:
[0117] Receives requests to create the target service in the Kubernetes system.
[0118] Based on the resource information of the running services related to the target service in the Kubernetes system, the computer resource usage of the target service is predicted.
[0119] A container for the target service is created in the Kubernetes system, and initial computer resources are configured for the container based on the predicted computer resource usage.
[0120] The target service is run based on the container configured with initial computer resources, and the computer resource usage of the container is obtained.
[0121] Based on the obtained computer resource usage, the initial computer resources configured for the container are adjusted, and the adjusted container is used to run the target service.
[0122] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification 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, etc.) containing computer-usable program code.
[0123] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0124] The above are merely embodiments of this specification and are not intended to limit the scope of this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification. Furthermore, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of this document.
Claims
1. A service creation method of a Kubernetes system, characterized by, The method comprises: receiving a request for creating a target service in a Kubernetes system, the request being initiated by a user end; predicting computer resource usage of the target service based on resource information corresponding to a running service related to the target service in the Kubernetes system, comprising: determining a running service matching profile information of the target service from the Kubernetes system; performing weighted calculation on computer resources configured for a container corresponding to the running service based on a ratio of an actual query rate per second of the running service to a theoretical query rate per second of the target service, to obtain computer resource usage of the target service; creating a container of the target service in the Kubernetes system, and configuring initial computer resources for the container based on the predicted computer resource usage, comprising: sending the predicted computer resource usage to the user end for recommendation; receiving computer resource application quantity fed back by the user end after the recommendation, and adjusting the predicted computer resource usage based on the computer resource application quantity; and configuring initial computer resources for the container using the adjusted computer resource usage; running the target service based on the container configured with the initial computer resources, and obtaining computer resource usage of the container; adjusting the initial computer resources configured for the container based on the obtained computer resource usage, and the adjusted container is used to run the target service.
2. The method of claim 1, wherein: obtaining computer resource usage of the container based on the container configured with the initial computer resources running the target service, comprises: controlling the container configured with the initial computer resources to run the target service in a simulation environment before the container is enabled, and obtaining computer resource usage of the container; after adjusting the initial computer resources configured for the container based on the obtained computer resource usage, the method further comprises: setting the container with adjusted computer resources to an enabled state.
3. The method of claim 1, wherein: the theoretical query rate per second of the target service is determined based on profile information of the target service.
4. The method of claim 2, wherein: before obtaining computer resource usage of the container based on the container configured with the initial computer resources running the target service, the method further comprises: configuring a monitoring component for monitoring computer resource usage of the container into the container; wherein the container enables the monitoring component to provide computer resource usage of the container when running the target service.
5. The method of claim 1, wherein: the user end comprises a UI user end.
6. A Kubernetes system, characterized in that, The method comprises: a receiving module configured to receive a request for creating a target service in a Kubernetes system, the request being initiated by a user end; The prediction module is configured to predict computer resource usage of the target service based on resource information of a running service related to the target service in a Kubernetes system, including: determining a running service matching the profiling information of the target service from the Kubernetes system; performing weighted calculation on computer resources configured for a container corresponding to the running service based on a ratio of an actual query rate per second of the running service to a theoretical query rate per second of the target service, to obtain computer resource usage of the target service; The configuration module is configured to create a container of the target service in the Kubernetes system, and configure initial computer resources for the container based on the predicted computer resource usage, including: sending the predicted computer resource usage to the user end for recommendation; receiving computer resource application amount fed back by the user end after the recommendation, and adjusting the predicted computer resource usage based on the computer resource application amount; and configuring initial computer resources for the container using the adjusted computer resource usage; The monitoring module is configured to run the target service based on the container configured with the initial computer resources, and obtain computer resource usage of the container; The adjustment module is configured to adjust the initial computer resources configured for the container based on the obtained computer resource usage, and the adjusted container is used to run the target service.
7. An electronic device, comprising: A processor; and a memory arranged to store computer-executable instructions, which when executed cause the processor to perform the method of any one of claims 1 to 5.
8. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions executable by one or more processors to perform all or a subset of the steps of any of methods 1-7. The one or more programs, when included in an electronic device including a plurality of applications, perform the method of any one of claims 1 to 5.
Citation Information
Patent Citations
A method and apparatus for managing resources in a cloud data system
CN109144727A
A method and apparatus for allocating container resource quota
CN109144734A