CN113391921B - Resource quota checking method for application instance - Google Patents
Resource quota checking method for application instance Download PDFInfo
- Publication number
- CN113391921B CN113391921B CN202110665064.3A CN202110665064A CN113391921B CN 113391921 B CN113391921 B CN 113391921B CN 202110665064 A CN202110665064 A CN 202110665064A CN 113391921 B CN113391921 B CN 113391921B
- Authority
- CN
- China
- Prior art keywords
- resource quota
- quota
- resource
- application
- container
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the field of cloud computing, and particularly provides a resource quota checking method of an application instance, which is used for supplementing service scenes related to the application instance based on a K8S cluster, guaranteeing the performance of deploying an application program by prejudging the resource quota and improving the cloud service user experience. Compared with the prior art, the cloud service user experience is improved by taking the service scene related to the application instance into consideration on the basis of k8S and prejudging the resource quota to ensure the performance of the deployed application program.
Description
Technical Field
The invention relates to the field of cloud computing, and particularly provides a resource quota checking method of an application instance.
Background
The cloud-up becomes a necessary choice for the continuous development of enterprises, and the era of fully using cloud services to build software services has come. The Yun Yuansheng architecture strips a large number of nonfunctional characteristics of Iaas and Paas from service codes compared with the traditional architecture, so that the technical attention scope of service code developers is reduced, and the nonfunctional capability of the application is improved through cloud services.
When deploying business codes on a cloud vendor-provided K8S cluster, it is often insufficient to consider only the resource quota of the business container. In a limited scenario, if resource consumption of an Istio-sidecar container self injected automatically is not considered, service Pod start failure can be caused; failure to reserve sufficient resource quota for the application publishing policy can result in failure of the application upgrade during grayscale publishing and blue-green publishing.
Disclosure of Invention
The invention provides a resource quota checking method for an application instance with strong practicability aiming at the defects of the prior art.
The technical scheme adopted for solving the technical problems is as follows:
a resource quota checking method of an application instance is based on a K8S cluster, supplements service scenes related to the application instance, guarantees the performance of deploying an application program by prejudging the resource quota, and is used for improving cloud service user experience.
Further, the method comprises the following steps:
s1, acquiring resource quota information under a current naming space;
s2, comparing the initial container resource request with the residual resource quota;
s3, judging the multi-copy condition;
s4, judging an application release mode;
s5, judging the resource quota of the application container;
s6, comprehensively considering and judging whether the quota is sufficient or insufficient.
Further, in step S1, resource quota information under the current namespace is obtained, the sidecar is automatically injected into the K8S cluster by using the atio, and a preset sidecar container resource is reserved in the resource quota.
Further, in step S2, the initial container resource request and the remaining resource quota in the application instance are compared, and if the resource quota is exceeded, a prompt message that the corresponding resource request exceeds the resource quota is returned.
Further, in step S3, the multi-copy condition is further determined, whether the sum of the multiple-copy initial container resource quota is satisfied is determined, if not, the quota is insufficient; if yes, judging whether the sum of the resource quotas of the application container is met.
Further, in step S4, the application instance publishing mode for the initial container resource quota and the application container resource quota is rolling publishing, gray publishing or blue-green publishing.
Preferably, when rolling release is adopted, no processing is performed; when gray release and blue-green release are adopted, two times of resource quota is reserved.
Further, in step S5, the resource quota of the application container is determined, whether the sum of the resource quota of the multi-copy application container is satisfied is determined, if not, the quota is insufficient; if so, the quota is sufficient.
Further, in step S6, if all the judgments indicate that the current namespace resource quota is sufficient, an application instance is created and upgraded according to the selected publishing mode.
Compared with the prior art, the resource quota checking method of the application instance has the following outstanding beneficial effects:
the invention provides a resource quota checking method of an application instance, which considers the service scene related to the application instance on the basis of k8S, and ensures the performance of the deployed application program by prejudging the resource quota, thereby improving the cloud service user experience.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method for verifying a resource quota of an application instance;
FIG. 2 is a conceptual diagram of an application and application instance of a method for verifying a resource quota of an application instance.
Detailed Description
In order to provide a better understanding of the aspects of the present invention, the present invention will be described in further detail with reference to specific embodiments. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
A preferred embodiment is given below:
as shown in fig. 1, a method for checking a resource quota of an application instance in this embodiment includes the following steps:
s1, acquiring resource quota information under the current name space, namely acquiring resource Quote resources under the name space in k 8S.
Reference message:
if the cluster is configured to automatically inject the Istio sidecar in the Pod, reserving n parts of preset sidecar container resources (n is the copy number) in the resource quota;
taking CPU limitations as an example:
available resource quota for namespace quota-test = hard. Limits. Cpu-used. Limits. Cpu
Residual resource quota for namespace quota-test = hard. Limits. Cpu-used. Limits. Cpu-n. Ission. Side car. Limits. Cpu (where n is the number of copies)
S2, firstly, comparing the sum of the initial container resource requests/limits in the application instance with the residual resource quota, and if the resource quota is exceeded, returning prompt information corresponding to the resource requests/limits exceeding the resource quota;
resource quota part reference message:
taking CPU limitations as an example:
the available resource quota-limits of namespace-test.cpu <0 returns an error message that "CPU limit exceeded resource quota, please reduce CPU limit. "
S3, judging the multi-copy condition, and if the multi-copy condition exceeds the resource quota, returning prompt information that the corresponding resource request (limitation) exceeds the resource quota;
taking CPU limitations as an example:
available resource quota-n.limits of namespace quota-test <0 (n is the number of copies)
An error message is returned that the CPU limit exceeds the resource quota and the number of copies or the CPU limit is reduced. "
S4, judging an application release mode, performing no processing during rolling release, and reserving double resource quota during gray release (canary release) and bluish-green release;
s5, judging the resource quota of the application container in the application instance by adopting the same strategy after judging the resource quota of the initial container, and sequentially judging the resource quota and the application container without superposition; if the initial container quota is judged not to be passed, adding an initial container word before returning error information, wherein the initial container word is like an initial container CPU limit exceeding a resource quota, a CPU limit is reduced, and the application container is the same.
And S6, if all the judgment results show that the current namespaces have sufficient resource quota, the application instance can be created/upgraded according to the selected release mode, and error information is not returned.
The current application example passes all judgment, namely, firstly passes the sum check of the initial container resource quota, specifically comprises a CPU request, a CPU limit, a memory request and a memory limit, and further comprises a GPU request/limit when GPU resource quota is required; and then, checking the sum of the resource quota of the application container, wherein the sum of the resource quota of the application container specifically comprises a CPU request, a CPU limit, a memory request and a memory limit, and if the GPU resource quota is required, the sum of the resource quota of the application container also comprises a GPU request/limit.
In order to successfully complete gray release and blue-green release, a part of users continue to use the old version, and a part of users start to use the new version. That is, a part of users continue to use the product V1, another part of users use the product V2, the control effect can be fast once the problem occurs, if the users do not have any objection to the V2, the range is gradually expanded, and all users are migrated to the V2.
That is, in the process that the resource quota required by an application instance is (1cpu+1gb memory), two versions of application instances of V1 and V2 are simultaneously run for a period of time, and both have the same requirement of the resource quota, so in order to successfully complete the publishing, two times of the resource quota (i.e. 2cpu+2gb memory) is reserved.
As shown in fig. 2, an application space (such as a web-APP) may include multiple applications (web applications, mysql applications, redis applications), and may be published across multiple nasspace environments, where an application instance may be generated, where an application instance in an environment (web-APP-pre-production environment) has multiple deployments, where a deployment corresponds to a deployment (stateless workload) or statefulset (stateful workload), where each deployment may have multiple publications, where each publication may select a different publication policy (e.g., canary publication, bluish green publication, etc.), where each publication generates a new application instance, where the deployment may define an application template to use or be a mirror image.
In particular, the method comprises the steps of,
(1) creating application instances based on an application, one application may correspond to multiple application instances
(2) Examples of applications are a variety of release policies: such as rolling distribution, bluish green distribution, AB distribution, canary distribution, etc
(3) Application instances can be deployed as two workloads: stateless workload and stateful workload
(4) The image required by the application instance may build the pulled code into an image for deployment of the application instance and store it in a repository
(5) An application instance that is successfully deployed may access a service through routing
(6) Deployment of application instances may also customize the number of copies, hanging on volumes or existing mirror images of demand
(7) Application instances may also be deployed through application templates
The actual operation code is as follows:
the above specific embodiments are merely specific examples of the present invention, and the scope of the present invention includes, but is not limited to, the specific embodiments described above, any suitable changes or substitutions made by one of ordinary skill in the art, and any claim of the resource quota checking method according to an application example of the present invention, shall fall within the scope of the present invention.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (1)
1. The resource quota checking method for the application instance is characterized by supplementing service scenes related to the application instance based on a K8S cluster, guaranteeing the performance of the application deployment program by prejudging the resource quota and improving the cloud service user experience;
the method comprises the following steps:
s1, acquiring resource quota information under a current naming space, automatically injecting a sidecar into a K8S cluster by using an Istio, and reserving preset sidecar container resources in the resource quota;
s2, comparing the initial container resource request with the residual resource quota in the application instance, and returning prompt information that the corresponding resource request exceeds the resource quota if the resource quota is exceeded;
s3, judging the multi-copy condition, judging whether the sum of the resource quota of the multi-copy initial container is met, and if not, judging that the quota is insufficient; if yes, judging whether the sum of the resource quotas of the application container is met;
s4, the issuing modes of the application instance for the initial container resource quota and the application container resource quota are rolling issuing, gray issuing or blue-green issuing;
when rolling release is adopted, no processing is performed; when gray release and blue-green release are adopted, two times of resource quota is reserved;
s5, judging the resource quota of the application container, judging whether the sum of the resource quota of the multi-copy application container is met, and if not, the quota is insufficient; if yes, the quota is sufficient;
and S6, if all the judgment shows that the current namespaces have sufficient resource quota, creating and upgrading the application instance according to the selected issuing mode.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110665064.3A CN113391921B (en) | 2021-06-16 | 2021-06-16 | Resource quota checking method for application instance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110665064.3A CN113391921B (en) | 2021-06-16 | 2021-06-16 | Resource quota checking method for application instance |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113391921A CN113391921A (en) | 2021-09-14 |
CN113391921B true CN113391921B (en) | 2023-04-28 |
Family
ID=77621373
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110665064.3A Active CN113391921B (en) | 2021-06-16 | 2021-06-16 | Resource quota checking method for application instance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113391921B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114356344A (en) * | 2021-12-23 | 2022-04-15 | 马上消费金融股份有限公司 | Application deployment method and device, electronic equipment and storage medium |
CN116431335B (en) * | 2023-03-21 | 2024-06-07 | 哈尔滨工业大学 | Control group-based container message queue resource quota control method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111522639A (en) * | 2020-04-16 | 2020-08-11 | 南京邮电大学 | Multidimensional resource scheduling method under Kubernetes cluster architecture system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10491541B2 (en) * | 2016-10-10 | 2019-11-26 | International Business Machines Corporation | Quota management protocol for shared computing systems |
CN109086135B (en) * | 2018-07-26 | 2021-10-26 | 北京百度网讯科技有限公司 | Resource scaling method and device, computer 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 |
CN112306631A (en) * | 2020-10-14 | 2021-02-02 | 苏州浪潮智能科技有限公司 | Method, controller and host for scheduling kubernets resources |
-
2021
- 2021-06-16 CN CN202110665064.3A patent/CN113391921B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111522639A (en) * | 2020-04-16 | 2020-08-11 | 南京邮电大学 | Multidimensional resource scheduling method under Kubernetes cluster architecture system |
Also Published As
Publication number | Publication date |
---|---|
CN113391921A (en) | 2021-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10540159B2 (en) | Model-based virtual system provisioning | |
US10616132B2 (en) | Managing user privileges for computer resources in a networked computing environment | |
US8516037B2 (en) | Methods for dynamic partitioning of applications in client-server environments | |
KR101643022B1 (en) | Catalog-based software component management | |
JP6291034B2 (en) | User-influenced placement of virtual machine instances | |
US20210289024A1 (en) | Dynamic execution resource selection for customized workflow tasks | |
CN113391921B (en) | Resource quota checking method for application instance | |
US20130311598A1 (en) | Cloud-based data item sharing and collaboration among groups of users | |
US20140047509A1 (en) | Authorizing computing resource access based on calendar events in a networked computing environment | |
CN105229603B (en) | It is accessed when controlling the operation to Application Programming Interface | |
KR20170133120A (en) | System and mehtod for managing container image | |
JP2013522769A (en) | Virtual machine image update service | |
US8701083B2 (en) | Systems and methods for varying software build properties using primary and supplemental build files | |
US20130185434A1 (en) | Cloud-based Content Management System | |
US20140019954A1 (en) | Controlling access to software component state | |
Sun et al. | Mapping application requirements to cloud resources | |
CN112449021B (en) | Internet resource screening method and device | |
US20170315785A1 (en) | Concurrent authoring session management for declarative document | |
US12007981B2 (en) | Blockchain selective world state database | |
CN116097258A (en) | Ensuring secure provisioning of blockchain infrastructure | |
US20220051189A1 (en) | Automatic negotiation apparatus, automatic negotiation method, and computer-readable recording medium | |
US20240195872A1 (en) | System and method to guarantee provenance of information, system and method for granting an access to a resource | |
CN118245137B (en) | Method, system, equipment and medium for managing data object | |
AU2022416127B2 (en) | Process parasitism-based branch prediction method and device for serverless computing | |
US20230176916A1 (en) | Degradation planning and mitigation in hybrid cloud environments |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |