CN112559186A - Novel Kubernetes container resource expansion and contraction method - Google Patents

Novel Kubernetes container resource expansion and contraction method Download PDF

Info

Publication number
CN112559186A
CN112559186A CN202011524569.XA CN202011524569A CN112559186A CN 112559186 A CN112559186 A CN 112559186A CN 202011524569 A CN202011524569 A CN 202011524569A CN 112559186 A CN112559186 A CN 112559186A
Authority
CN
China
Prior art keywords
reaches
resource
expansion
container
executing
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.)
Granted
Application number
CN202011524569.XA
Other languages
Chinese (zh)
Other versions
CN112559186B (en
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.)
Beijing Yunsi Imagination Technology Co ltd
Original Assignee
Beijing Yunsi Imagination Technology 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 Beijing Yunsi Imagination Technology Co ltd filed Critical Beijing Yunsi Imagination Technology Co ltd
Priority to CN202011524569.XA priority Critical patent/CN112559186B/en
Publication of CN112559186A publication Critical patent/CN112559186A/en
Application granted granted Critical
Publication of CN112559186B publication Critical patent/CN112559186B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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
    • G06F9/505Allocation 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

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

A new Kubernetes container resource expansion and contraction method comprises the following specific steps: s1, acquiring Metrics Server monitoring information, and judging whether the resource usage reaches the capacity expansion standard and the capacity reduction standard: if the capacity expansion standard is reached, executing S2; s2, judging whether the number of instances reaches the upper limit; if yes, go to S3; s3, judging whether the resource use reaches the upper limit; if not, executing S4; s4, judging whether the increased resources can be scheduled successfully; if yes, go to S5; s5, creating a new deployment set, increasing the number of resources and expanding the capacity; if the resource usage reaches the capacity reduction standard, executing S10; s10, judging whether the number of the deployment sets reaches the minimum value; if the number of deployment sets does not reach the minimum value, executing S11; and S11, deleting the newly created deployment set and carrying out capacity reduction. The invention carries out the expansion and contraction at the level of the deployment set, so that the horizontal expansion and the vertical expansion coexist, a more comprehensive and comprehensive elastic expansion mechanism is provided, and the expansion and contraction efficiency is improved.

Description

Novel Kubernetes container resource expansion and contraction method
Technical Field
The invention relates to a Kubernetes container resource arrangement platform, in particular to a novel Kubernetes container resource expansion and contraction method.
Background
One core function of Kubernetes is to support elastic expansion and contraction of container resources so as to deal with the scene that the system load pressure changes along with time; when the load pressure is high, the container resources are automatically expanded to ensure the response speed of the system and prevent the system from being broken down by large flow; and when the load is low, the container resources are automatically reduced to save the resources. The basic unit of Kubernetes resource scheduling is a container group (Pod), a group of same Pod resources are managed through a Deployment set (Deployment), the value of the copy number (Replica) in the Deployment set is the number of the pods managed by the Deployment set, and the CPU and the memory resources of the container in each Pod are configured in a Pod template of the Deployment set; the current Kubernetes container resource elastic expansion and contraction includes Horizontal expansion and contraction (HPA) and Vertical expansion and contraction (VPA).
In the prior art, horizontal expansion and vertical expansion of the same Deployment are possibly in conflict and cannot be used simultaneously; if the horizontal expansion is used only, the scene that the lowest resource demand exceeds the current configuration value after the system runs for a period of time cannot be dealt with; if the vertical expansion is used only, the vertical expansion is limited by node resources, and has an upper limit, so that a scene with extremely high resource demand cannot be met, and the existing Pod needs to be deleted and reconstructed during the vertical expansion, which may cause interruption to the existing service connection request.
Disclosure of Invention
Objects of the invention
In order to solve the technical problems in the background technology, the invention provides a novel Kubernetes container resource expansion and contraction method.
(II) technical scheme
The invention provides a novel Kubernetes container resource expansion and contraction method, which comprises the following specific steps:
s1, acquiring Metrics Server monitoring information, and judging whether the resource usage reaches the capacity expansion standard and the capacity reduction standard:
if the resource usage reaches the capacity expansion standard, executing S2;
if the resource usage reaches the capacity reduction standard, executing S10;
s2, judging whether the number of instances reaches the upper limit;
if the number of instances reaches the upper limit, go to S3;
if the number of instances reaches the non-upper limit, go to S6;
s3, judging whether the resource use reaches the upper limit;
if the resource usage reaches the upper limit, returning to execute S1;
if the resource usage does not reach the upper limit, executing S4;
s4, judging whether the increased resources can be scheduled successfully;
if the resource pre-scheduling is successfully increased, executing S5;
if the increase of the resource pre-scheduling fails, returning to execute S1;
s5, creating a new deployment set and increasing the number of resources;
s6, judging whether the resource use reaches the upper limit;
if the resource usage reaches the upper limit, go to S9;
if the resource usage does not reach the upper limit, executing S7;
s7, judging whether the increased resources can be scheduled successfully;
if the resource pre-scheduling is successfully increased, executing S8;
if the increase of the resource pre-scheduling fails, executing S9;
s8, creating a new deployment set, and increasing the number of instances and resources;
s9, creating a new deployment set, and only increasing the number of instances;
s10, judging whether the number of the deployment sets reaches the minimum value;
if the number of the deployment sets reaches the minimum value, returning to the step S1;
if the number of deployment sets does not reach the minimum value, executing S11;
and S11, deleting the newly created deployment set.
Preferably, also includes Kubernetes' container; the Kubernetes container includes a horizontal container bank jack and a vertical container bank jack.
Preferably, the horizontal container group retractors are connected with the deployment set; the deployment set includes a container group copy number; the container group replica numbers include container group A1, container group A2, … …, and container group AN.
Preferably, the vertical container group telescopic device is connected with the deployment container resource; the vertical container group expansion piece is connected with a deployment set; the deployment set includes container group resources; the container group resources include container group B1, container group B2, … …, and container group BN.
Compared with the prior art, the technical scheme of the invention has the following beneficial technical effects:
in the invention, the capacity expansion is not carried out at the Pod level, but at the Deployment level; the newly expanded Deployment and the original Deployment can realize the effects of horizontal expansion and vertical expansion at different values of Replicas, a container CPU and an internal memory, provide a more comprehensive and comprehensive elastic expansion mechanism, improve the efficiency of expansion and contraction, perform vertical expansion under the condition of not deleting and rebuilding the existing Pod and avoid causing long service connection interruption.
Drawings
Fig. 1 is a flow chart of a new kubernets container resource expansion and contraction method provided by the present invention.
Fig. 2 is a horizontal container group expansion and contraction device of a new kubernets container resource expansion and contraction method provided by the invention.
Fig. 3 is a vertical container group expansion and contraction device of a new Kubernetes container resource expansion and contraction method provided by the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
As shown in fig. 1-3, the new kubernets container resource expansion and contraction method provided by the present invention includes the following specific steps:
s1, acquiring Metrics Server monitoring information, and judging whether the resource usage reaches the capacity expansion standard and the capacity reduction standard:
if the resource usage reaches the capacity expansion standard, executing S2;
if the resource usage reaches the capacity reduction standard, executing S10;
s2, judging whether the number of instances reaches the upper limit;
if the number of instances reaches the upper limit, go to S3;
if the number of instances reaches the non-upper limit, go to S6;
s3, judging whether the resource use reaches the upper limit;
if the resource usage reaches the upper limit, returning to execute S1;
if the resource usage does not reach the upper limit, executing S4;
s4, judging whether the increased resources can be scheduled successfully;
if the resource pre-scheduling is successfully increased, executing S5;
if the increase of the resource pre-scheduling fails, returning to execute S1;
s5, creating a new deployment set and increasing the number of resources;
s6, judging whether the resource use reaches the upper limit;
if the resource usage reaches the upper limit, go to S9;
if the resource usage does not reach the upper limit, executing S7;
s7, judging whether the increased resources can be scheduled successfully;
if the resource pre-scheduling is successfully increased, executing S8;
if the increase of the resource pre-scheduling fails, executing S9;
s8, creating a new deployment set, and increasing the number of instances and resources;
s9, creating a new deployment set, and only increasing the number of instances;
s10, judging whether the number of the deployment sets reaches the minimum value;
if the number of the deployment sets reaches the minimum value, returning to the step S1;
if the number of deployment sets does not reach the minimum value, executing S11;
and S11, deleting the newly created deployment set.
In the invention, the capacity expansion is not carried out at the Pod level, but at the Deployment level; the newly expanded Deployment and the original Deployment can realize the effects of horizontal expansion and vertical expansion at different values of Replicas, a container CPU and an internal memory, provide a more comprehensive and comprehensive elastic expansion mechanism, improve the efficiency of expansion and contraction, perform vertical expansion under the condition of not deleting and rebuilding the existing Pod and avoid causing long service connection interruption.
In an alternative embodiment, a kubernets container is also included; the Kubernetes container includes a horizontal container bank jack and a vertical container bank jack.
In an alternative embodiment, horizontal container group expanders connect deployment sets; the deployment set includes a container group copy number; the container group replica numbers include container group A1, container group A2, … …, and container group AN.
In an alternative embodiment, vertical vessel group expanders connect the deployment set; the deployment set includes container group resources; the container group resources include container group B1, container group B2, … …, and container group BN.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.

Claims (4)

1. A new Kubernetes container resource expansion and contraction method is characterized by comprising the following specific steps:
s1, acquiring Metrics Server monitoring information, and judging whether the resource usage reaches the capacity expansion standard and the capacity reduction standard:
if the resource usage reaches the capacity expansion standard, executing S2;
if the resource usage reaches the capacity reduction standard, executing S10;
s2, judging whether the number of instances reaches the upper limit;
if the number of instances reaches the upper limit, go to S3;
if the number of instances reaches the non-upper limit, go to S6;
s3, judging whether the resource use reaches the upper limit;
if the resource usage reaches the upper limit, returning to execute S1;
if the resource usage does not reach the upper limit, executing S4;
s4, judging whether the increased resources can be scheduled successfully;
if the resource pre-scheduling is successfully increased, executing S5;
if the increase of the resource pre-scheduling fails, returning to execute S1;
s5, creating a new deployment set and increasing the number of resources;
s6, judging whether the resource use reaches the upper limit;
if the resource usage reaches the upper limit, go to S9;
if the resource usage does not reach the upper limit, executing S7;
s7, judging whether the increased resources can be scheduled successfully;
if the resource pre-scheduling is successfully increased, executing S8;
if the increase of the resource pre-scheduling fails, executing S9;
s8, creating a new deployment set, and increasing the number of instances and resources;
s9, creating a new deployment set, and only increasing the number of instances;
s10, judging whether the number of the deployment sets reaches the minimum value;
if the number of the deployment sets reaches the minimum value, returning to the step S1;
if the number of deployment sets does not reach the minimum value, executing S11;
and S11, deleting the newly created deployment set.
2. The new Kubernetes container resource expansion and contraction method as claimed in claim 1, further comprising a Kubernetes container; the Kubernetes container includes a horizontal container bank jack and a vertical container bank jack.
3. The new Kubernetes container resource expansion and contraction method as claimed in claim 2, wherein the horizontal container group expanders are connected to the deployment set; the deployment set includes a container group copy number; the container group replica numbers include container group A1, container group A2, … …, and container group AN.
4. The new Kubernetes container resource expansion and contraction method as claimed in claim 2, wherein the vertical container group expanders are connected to the deployment set; the deployment set includes container group resources; the container group resources include container group B1, container group B2, … …, and container group BN.
CN202011524569.XA 2020-12-22 2020-12-22 Kubernetes container resource expansion and contraction method Active CN112559186B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011524569.XA CN112559186B (en) 2020-12-22 2020-12-22 Kubernetes container resource expansion and contraction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011524569.XA CN112559186B (en) 2020-12-22 2020-12-22 Kubernetes container resource expansion and contraction method

Publications (2)

Publication Number Publication Date
CN112559186A true CN112559186A (en) 2021-03-26
CN112559186B CN112559186B (en) 2021-09-24

Family

ID=75032082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011524569.XA Active CN112559186B (en) 2020-12-22 2020-12-22 Kubernetes container resource expansion and contraction method

Country Status (1)

Country Link
CN (1) CN112559186B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297031A (en) * 2021-05-08 2021-08-24 阿里巴巴新加坡控股有限公司 Container group protection method and device in container cluster
CN115617517A (en) * 2022-10-12 2023-01-17 中航信移动科技有限公司 Data processing system for application pod control

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108108223A (en) * 2017-11-30 2018-06-01 国网浙江省电力公司信息通信分公司 Container Management platform based on Kubernetes
CN109067862A (en) * 2018-07-23 2018-12-21 北京邮电大学 The method and apparatus of API Gateway automatic telescopic
CN109379425A (en) * 2018-10-16 2019-02-22 浪潮软件集团有限公司 Distributed cluster deployment management method and device
CN109446032A (en) * 2018-12-19 2019-03-08 福建新大陆软件工程有限公司 The method and system of the scalable appearance of Kubernetes copy
CN109947537A (en) * 2019-03-28 2019-06-28 山东浪潮云信息技术有限公司 Create the system and method for cloud container service
CN110262899A (en) * 2019-06-20 2019-09-20 无锡华云数据技术服务有限公司 Monitor component elastic telescopic method, apparatus and controlled terminal based on Kubernetes cluster
CN110287029A (en) * 2019-06-27 2019-09-27 中国—东盟信息港股份有限公司 A method of it is adjusted based on kubernetes container resource dynamic
US20200341794A1 (en) * 2019-04-26 2020-10-29 Hewlett Packard Enterprise Development Lp Location-based virtualization workload placement

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108108223A (en) * 2017-11-30 2018-06-01 国网浙江省电力公司信息通信分公司 Container Management platform based on Kubernetes
CN109067862A (en) * 2018-07-23 2018-12-21 北京邮电大学 The method and apparatus of API Gateway automatic telescopic
CN109379425A (en) * 2018-10-16 2019-02-22 浪潮软件集团有限公司 Distributed cluster deployment management method and device
CN109446032A (en) * 2018-12-19 2019-03-08 福建新大陆软件工程有限公司 The method and system of the scalable appearance of Kubernetes copy
CN109947537A (en) * 2019-03-28 2019-06-28 山东浪潮云信息技术有限公司 Create the system and method for cloud container service
US20200341794A1 (en) * 2019-04-26 2020-10-29 Hewlett Packard Enterprise Development Lp Location-based virtualization workload placement
CN110262899A (en) * 2019-06-20 2019-09-20 无锡华云数据技术服务有限公司 Monitor component elastic telescopic method, apparatus and controlled terminal based on Kubernetes cluster
CN110287029A (en) * 2019-06-27 2019-09-27 中国—东盟信息港股份有限公司 A method of it is adjusted based on kubernetes container resource dynamic

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
CORENTIN DUPONT 等: "Edge computing in IoT context horizontal and vertical Linux container migration", 《IEEE》 *
倪海峰: "基于Kubernetes的云平台HPA算法的优化与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
张兆伟 等: "Kubernetes HPA技术在气象通信系统中的应用", 《信息技术》 *
杨茂 等: "基于Kubernetes的容器自动伸缩技术的研究", 《计算机与数字工程》 *
陈雁 等: "基于Kubernetes应用的弹性伸缩策略", 《计算机系统应用》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297031A (en) * 2021-05-08 2021-08-24 阿里巴巴新加坡控股有限公司 Container group protection method and device in container cluster
CN115617517A (en) * 2022-10-12 2023-01-17 中航信移动科技有限公司 Data processing system for application pod control
CN115617517B (en) * 2022-10-12 2023-11-10 中航信移动科技有限公司 Data processing system for applying pod control

Also Published As

Publication number Publication date
CN112559186B (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN112559186B (en) Kubernetes container resource expansion and contraction method
CN110647392A (en) Intelligent elastic expansion method based on container cluster
CN114385353A (en) Resource scheduling method and device, electronic equipment and storage medium
CN105847427A (en) Call center telephone traffic distribution system and method
CN103116475A (en) Method of automatic simplifying allocation expansion
CN103248522A (en) Performance data reporting method and device
CN112486664A (en) Node capacity expansion method, system, terminal and storage medium
CN112346848A (en) Method, device and terminal for managing memory pool
CN110070260A (en) Intelligent dispatching method, device, computer equipment and storage medium
CN106453794A (en) Call log processing method and device, and call recording method and system
CN110543357A (en) Method, related device and system for managing application program object
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN106855824B (en) Task stopping method and device and electronic equipment
CN114585035A (en) Voice call method, device and computer readable storage medium
CN105279063B (en) A kind of test method, device and server
CN115454598B (en) Service deployment and resource allocation method for partial decoupling data center
CN103593219B (en) A kind of quick start method of the highly reliable file system for NAND FLASH device
CN116225660B (en) Loading engine using method
CN109587183B (en) Request processing method and device
CN113347692B (en) Power utilization system, method and equipment, and computer-readable storage medium
CN110580193B (en) Virtualization-based single-site disaster recovery method, system and equipment
CN108632769B (en) Group complementary building method and device
CN105636001A (en) Mobile phone traffic management method and system
CN115914881A (en) High-concurrency acquisition method and medium for concentrator based on GO language and concentrator
CN115934186A (en) K8S Pod starting method, customized plug-in and electronic equipment

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