WO2022257347A1 - 一种容器云弹性伸缩的方法及集群服务器 - Google Patents

一种容器云弹性伸缩的方法及集群服务器 Download PDF

Info

Publication number
WO2022257347A1
WO2022257347A1 PCT/CN2021/128490 CN2021128490W WO2022257347A1 WO 2022257347 A1 WO2022257347 A1 WO 2022257347A1 CN 2021128490 W CN2021128490 W CN 2021128490W WO 2022257347 A1 WO2022257347 A1 WO 2022257347A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
expansion
preset
resource
resources
Prior art date
Application number
PCT/CN2021/128490
Other languages
English (en)
French (fr)
Inventor
赵贝
马忠飞
Original Assignee
聚好看科技股份有限公司
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 聚好看科技股份有限公司 filed Critical 聚好看科技股份有限公司
Publication of WO2022257347A1 publication Critical patent/WO2022257347A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • H04L41/5051Service on demand, e.g. definition and deployment of services in real time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Definitions

  • the present application relates to the field of network technology, and in particular to a method for container cloud elastic scaling and a cluster server.
  • Each microservice can have multiple instances (pods), which run distributedly on multiple nodes (Nodes) of the cloud platform in the form of containers. There are inevitably some peak periods in the application. With the sudden increase in business volume, it is difficult for microservice instances to cope with the increased traffic.
  • HPA horizontal pod autoscaling
  • HPA obtains the monitoring indicator data of the utilization rate of microservice resources through the resource monitoring system in the cluster, compares the monitoring indicator data with the preset threshold, and when the preset threshold is exceeded, Create a new instance; HPA can well solve the scaling of microservice instances, but when the node resources are insufficient to deploy new instances, HPA cannot be expanded, and thus automatic scaling cannot be achieved.
  • the public cloud with node expansion can expand the capacity by monitoring the instances in the cluster when they cannot be scheduled; however, it takes time to expand the nodes. After the existing nodes are created, the microservice traffic has dropped and cannot handle business requests well.
  • This application provides a container cloud elastic scaling method and a cluster server, which can be used to solve the existing technical problem that node expansion is performed when instances in the cluster cannot be scheduled, resulting in node expansion unable to meet the current microservice traffic demand.
  • the present application provides a method for container cloud elastic scaling, including:
  • the resource usage rate of the microservice satisfies the preset expansion conditions, and when the preset expansion conditions are met, calculate the resources required for expansion, and obtain the remaining nodes in the cluster node resources, the resources required for expansion include the number of pods and The pod corresponds to the specification;
  • a node meeting the minimum specification is selected from the node resource pool as a new node to join the cluster node resource.
  • determining whether the resource usage rate of the microservice satisfies a preset expansion condition includes:
  • a difference between the average resource usage rate and a preset upper threshold is calculated, and when the difference is smaller than a preset capacity expansion value, the resource usage rate satisfies a preset capacity expansion condition.
  • determining whether the resource usage rate of the microservice satisfies the preset expansion condition also includes:
  • the method further includes:
  • the node controller returns the node to be offline to the node resource pool.
  • the first aspect of the present application provides a method for container cloud elastic scaling, including obtaining the resource utilization rate of the microservice, and the microservice enables HPA; determining whether the resource utilization rate of the microservice meets the preset Expansion conditions, when the preset expansion conditions are met, calculate the resources required for expansion, and obtain the remaining nodes in the cluster node resources, the resources required for expansion include the number of pods and the corresponding specifications of the pods; determine the remaining nodes in the cluster node resources Whether the resources required for capacity expansion are met.
  • the present application provides a container cloud elastically scalable cluster server, including microservices, cluster node resources, automatic scaling controllers, node controllers, and node resource pools;
  • the automatic scaling controller is used to monitor the microservice and the cluster node resources, and the microservice enables HPA;
  • the resources required for expansion include the number of pods and the corresponding specifications of the pods;
  • the node controller in response to the request for the minimum specification required by the auto-scaling controller for capacity expansion, selects a node satisfying the minimum specification from the node resource pool as a new node to join the cluster node resources.
  • the preset expansion conditions include:
  • the resource utilization rate meets the preset expansion condition.
  • the preset expansion conditions further include:
  • the resource utilization rate meets the preset expansion condition.
  • the automatic scaling controller is further configured to determine whether the resource usage rate of the microservice satisfies a preset shrinking condition
  • the node controller in response to the request of the offline node, designates the node to be offline to go offline, and puts the node to be offline back into the node resource pool.
  • the device further includes a database, where the database is used to store node names and corresponding node specifications.
  • a node meeting the minimum specification is selected from the node resource pool as a new node to join the cluster node resource, including:
  • the second aspect of the present application provides a container cloud elastically scalable cluster server, including microservices, cluster node resources, automatic scaling controllers, node controllers, and node resource pools; the automatic scaling controller, For monitoring the microservice and the cluster node resources, the microservice enables HPA; determines whether the resource usage of the microservice satisfies the preset expansion condition; when the preset expansion condition is met, calculates the resources required for expansion , and, monitor the remaining nodes in the cluster node resources, the resources required for expansion include the number of pods and pod corresponding specifications; determine whether the remaining nodes in the cluster node resources meet the resources required for capacity expansion; when the remaining nodes do not meet the Resources required for capacity expansion, calculating the minimum specification required for capacity expansion according to the resources required for capacity expansion; sending a request for the minimum specification required for capacity expansion to the node controller; The required minimum specification is requested, and a node meeting the minimum specification is selected from the node resource pool as a new node to join the cluster
  • the device realizes node expansion and contraction in advance to ensure that the cluster has expansion conditions when the service is expanded, so as to realize two-level elastic expansion and contraction. You can schedule directly if you need to wait, better meet business needs, realize rapid expansion, and automatically shrink capacity after service traffic drops, saving costs.
  • Fig. 1 is a schematic structural diagram of the HPA function description of the embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a cluster server for container cloud elastic scaling according to an embodiment of the present application
  • FIG. 3 is a flow chart of cluster server expansion for container cloud elastic scaling according to an embodiment of the present application
  • FIG. 4 is a flow chart of cluster server expansion for container cloud elastic scaling according to another embodiment of the present application.
  • FIG. 5 is a flow chart of another cluster server expansion of container cloud elastic scaling according to the embodiment of the present application.
  • FIG. 6 is a flow chart of shrinking the capacity of the cluster server in the elastic scaling of the container cloud according to the embodiment of the present application.
  • module refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and/or software codes capable of performing the functions associated with the element.
  • Kubernetes is an open source container orchestration engine that supports automated deployment, large-scale scalability, and application container management; under a Kubernetes-based container cloud cluster, it manages and schedules a large number of microservices, and each microservice can have multiple instances.
  • nodes are the basic elements of container clusters, which can be virtual machines, physical machines, or host machines. Each node contains the pods required to run basic components.
  • Kubernetes has the function of automatically scaling HPA at the instance level.
  • HPA obtains the monitoring indicator data of the utilization rate of microservice resources through the resource monitoring system (Heapster) in the cluster, and automatically expands and reduces the number of pods in the microservice according to the monitoring indicator data.
  • Heapster is native to Kubernetes.
  • Heapster runs as a pod, automatically discovers cluster nodes, and obtains monitoring data from the nodes.
  • Deployment is responsible for managing stateless applications, that is, microprograms. Deployment declares pod templates and controls pod operation strategies. It is suitable for deploying stateless microservices. When the usage of microservices exceeds the preset threshold When the upper limit is reached, HPA will automatically create a new pod for the microservice to achieve capacity expansion.
  • HPA cannot achieve expansion, which will lead to a continuous increase in business load and the collapse of microservices; at present, some public clouds with node expansion and contraction monitor the instances in the cluster When scheduling is not possible, expand the capacity; however, it takes time to expand the nodes. After the existing nodes are created, the microservice traffic has dropped, and business requests cannot be processed effectively.
  • smart TV services have obvious peak periods, such as every night.
  • peak periods such as every night.
  • service instances during peak periods may be difficult to cope with increased traffic. If the peak period can be predicted in advance and the peak period is gradually over a long period of time.
  • the container cloud elastically scalable cluster server can include microservices (Service), automatic scaling controller (Autoscale Controller), cluster node resource, node controller (Node Controller) and node resource pool.
  • Microservices, nodes, auto-scaling controllers, and node controllers constitute a Kubernetes-based container cloud elastically scalable cluster server.
  • microservices automatically expand and shrink according to the amount of traffic; Resources determine whether the remaining resources of the node meet the instance requirements for capacity expansion, and expand new nodes or offline nodes through the nodes stored in the node resource pool; the automatic scaling controller monitors the monitoring index data of service resource utilization and the remaining status of nodes; nodes deploy microservices Receive the expansion and contraction request from the automatic scaling controller, and perform specific expansion and contraction operations.
  • the present application provides a container cloud elastically scalable cluster server, including microservices, cluster node resources, automatic scaling controllers, node controllers, and node resource pools; the automatic scaling controller is used to monitor the microservices and all The cluster node resources, the microservices enable HPA; determine whether the resource utilization rate of the microservices meets the preset expansion conditions; when the preset expansion conditions are met, calculate the resources required for expansion, and monitor the cluster node resources In the remaining nodes, the resources required for expansion include the number of pods and the corresponding specifications of pods; determine whether the remaining nodes in the cluster node resources meet the resources required for expansion; when the remaining nodes do not meet the resources required for expansion, according to the expansion
  • the required resources are calculated for the minimum specification required for capacity expansion; a request for the minimum specification required for capacity expansion is sent to the node controller; the node controller responds to the request for the minimum specification required for the expansion of the automatic scaling controller, from A node meeting the minimum specification is selected from the node resource pool as a new node to
  • the device realizes node expansion and contraction in advance to ensure that the cluster has expansion conditions when the service is expanded, so as to realize two-level elastic expansion and contraction. You can schedule directly if you need to wait, better meet business needs, realize rapid expansion, and automatically shrink capacity after service traffic drops, saving costs.
  • the HPA function is enabled for any microservice of the container cloud elastically scalable cluster server, and has the ability to automatically scale instances.
  • the monitoring content of the automatic scaling controller includes the resource utilization rate of the microservice and the situation of the remaining nodes in the cluster node resources.
  • the elastic expansion method of the container cloud applied on the device is as follows:
  • the resources required for capacity expansion include the number of pods and the corresponding specifications of pods.
  • the specific algorithm for the resources required for capacity expansion can be determined by collecting the current resource usage rate, the current number of pods, and the target resource usage rate.
  • the number of pods that need to be expanded can be obtained by the difference between the actual number of pods required and the current number of pods.
  • the resources required for the corresponding expansion include the number of pods being 2; at the same time, the corresponding specifications of the pods are also obtained .
  • the resources required for capacity expansion include the number of pods and the corresponding specifications of pods.
  • the service workload demand exceeds the remaining node capacity. At this time, nodes need to be added to increase the overall available resources of the cluster node resources.
  • Nodes are the basic elements of container clusters. Nodes depend on the business. Each node contains the basic components required to run pods.
  • the auto-scaling controller sends the minimum specification requirement for capacity expansion to the node controller, and sends a request for the minimum specification for capacity expansion from the service level to the node level.
  • This application provides node resources of different specifications through the node resource pool, which facilitates the introduction and offline of nodes quickly and saves resource costs. Selecting a node meeting the minimum specification from the node resource pool as a new node to join the cluster node resource.
  • the container cloud elastic scaling cluster server further includes a database for storing node names, node quantities and corresponding node specifications, and the node controller obtains suitable nodes from the database according to the minimum specifications.
  • the database performs the following operations: select the node that best meets the requirements from the node resource pool as the node to be added; perform node initialization on the node to be added, optimize the kernel parameters of the node to be added; call to install docker The script installs the docker service; calls and installs the Kubernetes system service script to install, and adds the node to be added as a new node to join the cluster node resource.
  • the present application provides a method for container cloud elastic scaling, including obtaining the resource utilization rate of the microservice, and the microservice enables HPA; determining whether the resource utilization rate of the microservice meets the preset expansion conditions, When the preset expansion conditions are met, calculate the resources required for expansion, and obtain the remaining nodes in the cluster node resources, the resources required for expansion include the number of pods and the corresponding specifications of the pods; determine whether the remaining nodes in the cluster node resources meet the capacity expansion Required resources, when the remaining nodes do not meet the resources required for expansion, calculate the minimum specification required for expansion according to the resources required for expansion; select a node that meets the minimum specification from the node resource pool according to the minimum specification required for expansion Join the cluster node resource as a new node.
  • This method realizes node expansion and contraction in advance, ensures that the cluster has expansion conditions when the service is expanded, and thus realizes two-level elastic expansion and contraction.
  • the expansion node is realized in advance, so that there is no need for service expansion. You can schedule directly if you need to wait, better meet business needs, realize rapid expansion, and automatically shrink capacity after service traffic drops, saving costs.
  • a method for elastically scaling container clouds in combination with a specific preset expansion condition includes the following execution steps:
  • the average resource usage rate is obtained; in some embodiments, the first preset time can be set to 5 minutes, by The data in this time period is averaged to obtain the average resource usage rate.
  • the preset expansion value is the range value of the sub-threshold area that is within the upper limit of the preset threshold and adjacent to the upper limit of the preset threshold. Through the sub-threshold area, as a basis for judgment, expand the capacity of the node in advance Make a judgment, so as to realize direct scheduling without waiting during service expansion.
  • the difference is smaller than the preset expansion value, the resource utilization rate meets the preset expansion condition.
  • the resources required for expansion include the number of pods and corresponding specifications of the pods, monitor the status of the remaining nodes in the cluster node resources, and determine whether the remaining nodes in the cluster node resources meet the resources required for capacity expansion. By comparing the number of pods required for capacity expansion and the corresponding specifications of pods with the remaining nodes, check whether the available resources of the remaining nodes can be successfully scheduled and executed.
  • the resources required for capacity expansion include the number of pods and the corresponding specifications of pods. The service workload demand exceeds the remaining node capacity. At this time, nodes need to be added to increase the overall available resources of the cluster node resources.
  • Nodes are the basic elements of container clusters. Nodes depend on the business. Each node contains the basic components required to run pods.
  • This application provides node resources of different specifications through the node resource pool, which facilitates the introduction and offline of nodes quickly and saves resource costs. Selecting a node meeting the minimum specification from the node resource pool as a new node to join the cluster node resource.
  • the present application provides a method for container cloud elastic scaling, including obtaining and monitoring the average resource usage rate of microservices within the first preset time, and the microservices enable HPA; calculating the average resource usage rate and the preset The difference between the upper threshold and the upper threshold. When the difference is less than the preset expansion value, calculate the resources required for expansion, and obtain the remaining nodes in the cluster node resources.
  • the resources required for expansion include the number of pods and the corresponding specifications of the pods; Whether the remaining nodes in the above cluster node resources meet the resources required for capacity expansion.
  • the method for performing container cloud elastic scaling includes the following execution steps:
  • a change trend of the resource usage rate is obtained by collecting the resource usage rate within a second preset time period. Combined with the trend prediction algorithm, the next resource usage rate is obtained.
  • the trend prediction algorithm can be through ARIMA model, neural network model, Prophet model, etc.
  • the preset expansion value is the range value of the sub-threshold area that is within the upper limit of the preset threshold and adjacent to the upper limit of the preset threshold. Through the sub-threshold area, as a basis for judgment, expand the capacity of the node in advance Make a judgment, so as to realize direct scheduling without waiting during service expansion.
  • the difference is smaller than the preset expansion value, the resource utilization rate meets the preset expansion condition.
  • the resources required for expansion include the number of pods and corresponding specifications of the pods, monitor the status of the remaining nodes in the cluster node resources, and determine whether the remaining nodes in the cluster node resources meet the resources required for capacity expansion. By comparing the number of pods required for capacity expansion and the corresponding specifications of pods with the remaining nodes, check whether the available resources of the remaining nodes can be successfully scheduled and executed.
  • the resources required for capacity expansion include the number of pods and the corresponding specifications of pods. The service workload demand exceeds the remaining node capacity. At this time, nodes need to be added to increase the overall available resources of the cluster node resources.
  • Nodes are the basic elements of container clusters. Nodes depend on the business. Each node contains the basic components required to run pods.
  • This application provides node resources of different specifications through the node resource pool, which facilitates the introduction and offline of nodes quickly and saves resource costs. Selecting a node meeting the minimum specification from the node resource pool as a new node to join the cluster node resource.
  • the present application provides a method for container cloud elastic scaling, which includes collecting the change trend of the microservice resource usage rate within the second preset time, and the microservice enables HPA; predicting the next resource usage according to the change trend rate, calculate the difference between the next resource usage rate and the preset threshold upper limit, when the difference is less than the preset expansion value, calculate the resources required for expansion, and obtain the remaining nodes in the cluster node resources, the expansion required Resources include the number of pods and the corresponding specifications of pods; determine whether the remaining nodes in the cluster node resources meet the resources required for capacity expansion, and when the remaining nodes do not meet the resources required for capacity expansion, calculate the minimum required resources for capacity expansion Specification: According to the minimum specification required for capacity expansion, a node meeting the minimum specification is selected from the node resource pool as a new node to join the cluster node resource.
  • This method realizes node expansion and contraction in advance, ensures that the cluster has expansion conditions when the service is expanded, and thus realizes two-level elastic expansion and contraction.
  • the expansion node is realized in advance, so that there is no need for service expansion. You can schedule directly if you need to wait, better meet business needs, realize rapid expansion, and automatically shrink capacity after service traffic drops, saving costs.
  • the HPA function is enabled to have the ability to automatically scale instances.
  • the monitoring content of the automatic scaling controller includes the resource utilization rate of the microservice and the situation of the remaining nodes in the cluster node resources.
  • Priority is given to judging the new node.
  • the new node When it is found that the new node has no related microservice instances, and the microservice has no expansion requirements or the remaining nodes of the current cluster node resources meet the expansion requirements, the new node will be taken as the node to be offline. Judgments are also made for other nodes. When other nodes are found to have no relevant microservice instances, they are regarded as nodes to be offline.
  • the present application provides a container cloud elastic scaling method to automatically shrink the capacity after the service traffic drops, saving costs.

Abstract

本申请提供一种容器云弹性伸缩的方法及集群服务器,集群服务器包括微服务、集群节点资源、自动伸缩控制器、节点控制器和节点资源池;方法包括判定微服务的资源使用率是否满足预设扩容条件,当满足预设扩容条件时,计算扩容所需资源,判定集群节点资源中剩余节点是否满足扩容所需资源,当剩余节点不满足扩容所需资源,根据扩容所需资源计算扩容所需的最小规格;根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入集群节点资源。通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,实现两级弹性扩缩容,实现快速扩容,更好的满足业务需求,在服务流量下降之后自动缩容,节约成本。

Description

一种容器云弹性伸缩的方法及集群服务器
本申请要求在2021年06月11日提交中国专利局、申请号为202110651643.2、发明名称为“一种容器云弹性伸缩的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络技术领域,尤其涉及一种容器云弹性伸缩的方法及集群服务器。
背景技术
在基于Kubernetes的容器云集群下,管理调度大量的微服务,每个微服务可以有多个实例(pod),以容器的形式,分布式的运行于云平台的多个节点(Node)上,应用中不可避免地存在一些高峰期,随着业务量的突增,进而导致微服务的实例难以应对增加流量。
Kubernetes具有pod水平自动伸缩(Horizontal Pod Autoscaling,HPA)功能,HPA通过集群内资源监控系统获取微服务资源的使用率的监控指标数据,比较监控指标数据和预设阈值,当超过预设阈值时,创建新的实例;HPA可以很好的解决微服务实例的伸缩,但在节点资源不足以部署新的实例时,会导致HPA无法扩容,进而无法实现自动伸缩。
相关技术中,具有节点扩容的公有云,通过监控集群中实例无法调度时,再扩容;然而,扩容节点需要时间,存在节点创建好之后,微服务流量已经下降,不能处理好业务请求。
发明内容
本申请提供了一种容器云弹性伸缩的方法及集群服务器,可用于解决现有的节点扩容是在集群中实例无法调度时进行,导致节点扩容无法满足当下微服务流量需求的技术问题。
第一方面,本申请提供一种容器云弹性伸缩的方法,包括:
获取微服务的资源使用率,所述微服务开启HPA;
判定所述微服务的资源使用率是否满足预设扩容条件,当满足预设扩容条件时,计算扩容所需资源,以及,获取集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;
判定所述集群节点资源中剩余节点是否满足扩容所需资源,当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;
根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
结合第一方面,在一种可实现方式中,判定所述微服务的资源使用率是否满足预设扩容条件,包括:
获取第一预设时间内微服务的资源使用率,并计算所述资源使用率的均值,得到平均资源使用率;
计算所述平均资源使用率与预设阈值上限的差值,当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
结合第一方面,在一种可实现方式中,判定所述微服务的资源使用率是否满足预设扩 容条件,还包括:
获取第二预设时间内的资源使用率,获取所述资源使用率的变化趋势,根据所述变化趋势预测下一次资源使用率;
计算下一次资源使用率与预设阈值上限的差值,当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
结合第一方面,在一种可实现方式中,所述方法还包括:
判定所述微服务的资源使用率是否满足预设缩容条件,当满足预设缩容条件时,监控所述集群节点资源中剩余节点,将没有相关微服务实例对应的节点作为待下线节点,向节点控制器发送下线节点请求;
所述节点控制器将所述待下线节点放回所述节点资源池。
由以上技术方案可知,本申请第一方面提供一种容器云弹性伸缩的方法,包括获取微服务的资源使用率,所述微服务开启HPA;判定所述微服务的资源使用率是否满足预设扩容条件,当满足预设扩容条件时,计算扩容所需资源,以及,获取集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;判定所述集群节点资源中剩余节点是否满足扩容所需资源,当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。该方法提前实现节点扩缩容,保证服务扩容时集群具有扩容条件,从而实现两级弹性扩缩容,通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,从而在服务扩容时不需要等待就可以直接调度,更好的满足业务需求,实现快速扩容,在服务流量下降之后自动缩容,节约成本。
第二方面,本申请提供一种容器云弹性伸缩的集群服务器,包括微服务、集群节点资源、自动伸缩控制器、节点控制器和节点资源池;
所述自动伸缩控制器,用于监控所述微服务和所述集群节点资源,所述微服务开启HPA;
判定所述微服务的资源使用率是否满足预设扩容条件;
当满足预设扩容条件时,计算扩容所需资源,以及,监控所述集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;
判定所述集群节点资源中剩余节点是否满足扩容所需资源;
当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;
向所述节点控制器发送扩容所需的最小规格请求;
所述节点控制器,响应所述自动伸缩控制器扩容所需的最小规格请求,从所述节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
结合第二方面,在一种可实现方式中,所述预设扩容条件,包括:
采集第一预设时间内微服务的资源使用率,并计算所述资源使用率的均值,得到平均资源使用率;
计算所述平均资源使用率与预设阈值上限的差值;
当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
结合第二方面,在一种可实现方式中,所述预设扩容条件,还包括:
采集第二预设时间内的资源使用率,获取所述资源使用率的变化趋势;
根据所述变化趋势预测下一次资源使用率;
计算下一次资源使用率与预设阈值上限的差值;
当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
结合第二方面,在一种可实现方式中,所述自动伸缩控制器,还用于判定所述微服务的资源使用率是否满足预设缩容条件;
当满足预设缩容条件时,监控所述集群节点资源中剩余节点,将没有相关微服务实例对应的节点作为待下线节点,向节点控制器发送下线节点请求;
所述节点控制器,响应于所述下线节点请求,指定所述待下线节点下线,并将所述待下线节点放回所述节点资源池。
结合第二方面,在一种可实现方式中,所述装置还包括数据库,所述数据库用于存储节点名称以及对应的节点规格。
结合第二方面,在一种可实现方式中,从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源,包括:
根据所述数据库,选择所述最小规格对应的节点作为待加入节点;
对所述待加入节点进行节点初始化,优化所述待加入节点的内核参数;
调用安装docker脚本,安装docker服务;
调用安装Kubernetes系统服务脚本,完成安装并将所述待加入节点加作为新节点加入所述集群节点资源。
由以上技术方案可知,本申请第二方面提供一种容器云弹性伸缩的集群服务器,包括微服务、集群节点资源、自动伸缩控制器、节点控制器和节点资源池;所述自动伸缩控制器,用于监控所述微服务和所述集群节点资源,所述微服务开启HPA;判定所述微服务的资源使用率是否满足预设扩容条件;当满足预设扩容条件时,计算扩容所需资源,以及,监控所述集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;判定所述集群节点资源中剩余节点是否满足扩容所需资源;当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;向所述节点控制器发送扩容所需的最小规格请求;所述节点控制器,响应所述自动伸缩控制器扩容所需的最小规格请求,从所述节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。该装置提前实现节点扩缩容,保证服务扩容时集群具有扩容条件,从而实现两级弹性扩缩容,通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,从而在服务扩容时不需要等待就可以直接调度,更好的满足业务需求,实现快速扩容,在服务流量下降之后自动缩容,节约成本。
附图说明
为了更清楚地说明本申请的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例HPA功能描述的结构示意图;
图2为本申请实施例容器云弹性伸缩的集群服务器的结构示意图;
图3为本申请实施例一种容器云弹性伸缩的集群服务器扩容的流程图;
图4为本申请实施例又一种容器云弹性伸缩的集群服务器扩容的流程图;
图5为本申请实施例另一种容器云弹性伸缩的集群服务器扩容的流程图;
图6为本申请实施例容器云弹性伸缩的集群服务器缩容的流程图。
具体实施方式
为使本申请示例性实施例的目的、技术方案和优点更加清楚,下面将结合本申请示例性实施例中的附图,对本申请示例性实施例中的技术方案进行清楚、完整地描述,显然,所描述的示例性实施例仅是本申请一部分实施例,而不是全部的实施例。
基于本申请中示出的示例性实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。此外,虽然本申请中公开内容按照示范性一个或几个实例来介绍,但应理解,可以就这些公开内容的各个方面也可以单独构成一个完整技术方案。
应当理解,本申请中说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,例如能够根据本申请实施例图示或描述中给出那些以外的顺序实施。
此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖但不排他的包含,例如,包含了一系列组件的产品或设备不必限于清楚地列出的那些组件,而是可包括没有清楚地列出的或对于这些产品或设备固有的其它组件。
本申请中使用的术语“模块”,是指任何已知或后来开发的硬件、软件、固件、人工智能、模糊逻辑或硬件或/和软件代码的组合,能够执行与该元件相关的功能。
本说明书通篇提及的“多个实施例”、“一些实施例”、“一个实施例”或“实施例”等,意味着结合该实施例描述的具体特征、结构或特性包括在至少一个实施例中。因此,本说明书通篇出现的短语“在多个实施例中”、“在一些实施例中”、“在至少另一个实施例中”或“在实施例中”等并不一定都指相同的实施例。此外,在一个或多个实施例中,具体特征、结构或特性可以任何合适的方式进行组合。因此,在无限制的情形下,结合一个实施例示出或描述的具体特征、结构或特性可全部或部分地与一个或多个其他实施例的特征、结构或特性进行组合。这种修改和变型旨在包括在本申请的范围之内。
随着网络技术的发展,对于网络服务的需求越来越多,在云平台集群环境下,越来越多基于Kubernetes(简称K8s)容器云集群被广范应用,集群是容器运行所需云资源的集合。Kubernetes是开源的一个容器编排引擎,它支持自动化部署、大规模可伸缩、应用容器化管理;在基于Kubernetes的容器云集群下,管理调度大量的微服务,每个微服务可以有多个实例,以容器的形式,分布式的运行于云平台的多个节点上;节点是容器集群组成的基本元素,可以是虚拟机、也可以是物理机、宿主机,每个节点都包含运行pod所需的基本组件。Kubernetes具有实例水平自动伸缩HPA功能,HPA通过集群内资源监控系统(Heapster)获取微服务资源的使用率的监控指标数据,根据监控指标数据自动扩展、缩减微服务中pod数量,其中Heapster是Kubernetes原生的集群监控方案,Heapster以pod的形式运行,会自动发现集群节点、从节点上获取监控数据。如图1所示,通过Deployment负责管理无状态的应用,即微程序,Deployment声明了pod模板,控制pod的运行策略,适用于部署无状态的微服务,当微服务的使用率超过预设阈值上限时,HPA就自动为该微服务创建出新的pod来实现扩容。
然而,节点剩余资源不足以部署一个新的pod情况时,HPA无法实现扩容,进而导致业务负载持续升高,进而微服务崩溃;目前,一些具有节点扩缩容的公有云,通过监控集群中实例无法调度时,再扩容;然而,扩容节点需要时间,存在节点创建好之后,微服务流量已经下降,不能有效的处理业务请求。
在一些实施例中,智能电视业务存在明显高峰期,比如说每天晚上,另外不可避免的存在一些不可预料的高峰,高峰期服务实例可能难以应对增加流量,如果可以提前预知高峰期并且高峰期是较长时间内逐渐发生的。
为了解决服务级和节点级的扩缩容有效性的问题,提供一种容器云弹性伸缩的集群服务器,所述容器云弹性伸缩的集群服务器可以包括微服务(Service)、自动伸缩控制器(Autoscale Controller)、集群节点资源、节点控制器(Node Controller)和节点资源池。
微服务、节点、自动伸缩控制器和节点控制器构成了基于Kubernetes的容器云弹性伸缩的集群服务器,如图2所示,微服务根据流量多少自动扩缩容;节点部署微服务,通过集群节点资源判断节点剩余资源是否满足扩容的实例需求,通过节点资源池存储的节点扩充新节点或者下放下线节点;自动伸缩控制器监控服务资源使用率的监控指标数据以及节点剩余情况;节点部署微服务接收自动伸缩控制器的扩缩容请求,执行具体的扩缩容操作。
本申请提供一种容器云弹性伸缩的集群服务器,包括微服务、集群节点资源、自动伸缩控制器、节点控制器和节点资源池;所述自动伸缩控制器,用于监控所述微服务和所述集群节点资源,所述微服务开启HPA;判定所述微服务的资源使用率是否满足预设扩容条件;当满足预设扩容条件时,计算扩容所需资源,以及,监控所述集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;判定所述集群节点资源中剩余节点是否满足扩容所需资源;当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;向所述节点控制器发送扩容所需的最小规格请求;所述节点控制器,响应所述自动伸缩控制器扩容所需的最小规格请求,从所述节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。该装置提前实现节点扩缩容,保证服务扩容时集群具有扩容条件,从而实现两级弹性扩缩容,通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,从而在服务扩容时不需要等待就可以直接调度,更好的满足业务需求,实现快速扩容,在服务流量下降之后自动缩容,节约成本。
如图3所示,本申请提供的部分实施例中,对于容器云弹性伸缩的集群服务器的任意一个微服务,均开启HPA功能,具备自动伸缩实例的能力。自动伸缩控制器监控内容包括微服务的资源使用率和集群节点资源中剩余节点的情况。应用在装置上的容器云弹性扩容的方法如下:
S101、监控微服务的资源使用率。
相关开启HPA微服务目前的资源使用率,包括CPU、内存或QPS(Query Per Second)者磁盘io等其他自定义资源。通过判定其资源使用率是否满足预设扩容条件来判断是否进行下一步骤操作,对于不同的资源使用率对应的预设扩容条件也存在差异。当满足预设扩容条件时,执行如下步骤:
S102、计算扩容所需资源,监控所述集群节点资源中剩余节点。
其中,所述扩容所需资源包括pod数以及pod对应规格,在一些实施例中,扩容所需资源的具体算法可以时通过采集目前资源使用率、目前pod数,以及,目标资源使用率来确定实际需要pod数,具体可以是:实际需要pod数=(目前资源使用率/目标资源使用率) *目前pod数。通过实际需要pod数与目前pod数的差值,可以得到需要扩充pod数量。
以CPU利用率为例,采集目前pod数为4,目前CPU使用率为90%,设定的目标CPU使用率为60%,则实际需要的pod数为:(90%/60%)*4=6个,根据需要pod数6个与目前pod数2个的差值2个,来扩充pod数量,此时对应的扩容所需资源包括pod数为2个;同时,也得到pod对应的规格。
监控集群节点资源中剩余节点的情况,并判定所述集群节点资源中剩余节点是否满足扩容所需资源。通过对比扩容所需资源需要的pod数以及pod对应规格与剩余节点,查看剩余节点具有的可用资源是否可以成功调度和执行扩容所需资源包括pod数以及pod对应规格,当不能满足时,即微服务工作负载需求超出了剩余节点容量,此时,需要添加节点来增加集群节点资源的整体可用资源。
S103、根据所述扩容所需资源计算扩容所需的最小规格。
扩容所需的最小规格是对于新节点的规格要求,节点作为容器集群组成的基本元素,节点取决于业务,每个节点都包含运行pod所需要的基本组成。
S104、发送扩容所需最小规格请求。
自动伸缩控制器向节点控制器发送扩容所需最小规格要求,从服务级向节点级发送扩容需要最小规格的请求。
S105、从节点资源池中选取满足最小规格的节点作为新节点。
本申请通过节点资源池,提供不同规格的节点资源,便于快捷的实现节点的引入和下线,节约资源成本。从所述节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
在一些实施例中,容器云弹性伸缩的集群服务器还包括数据库,用于存储节点名称、节点数量以及对应的节点规格,节点控制器根据最小规格在数据库中获取适合的节点。
根据最小规格,结合数据库,执行如下操作:从节点资源池中选择最符合要求的节点作为待加入节点;对所述待加入节点进行节点初始化,优化所述待加入节点的内核参数;调用安装docker脚本,安装docker服务;调用安装Kubernetes系统服务脚本安装,并将所述待加入节点加作为新节点加入集群节点资源。
继续以上述CPU利用率的例子得到扩容所需资源包括pod数为2个,对应的规格为2C2G,此时,我们得到对应的最小规格是4C4G的节点,对应数据库,当数据库中存在4C4G的节点则将其作为待加入节点;若不存在,则选择满足最小规格的节点作为待加入节点。
由以上技术方案可知,本申请提供一种容器云弹性伸缩的方法,包括获取微服务的资源使用率,所述微服务开启HPA;判定所述微服务的资源使用率是否满足预设扩容条件,当满足预设扩容条件时,计算扩容所需资源,以及,获取集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;判定所述集群节点资源中剩余节点是否满足扩容所需资源,当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。该方法提前实现节点扩缩容,保证服务扩容时集群具有扩容条件,从而实现两级弹性扩缩容,通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,从而在服务扩容时不需要等待就可以直接调度,更好的满足业务需求,实现快速扩容,在服务流量下降之后自动缩容,节约成本。
如图4所示,本申请提供的部分实施例中,结合一种具体预设扩容条件,对进行容器云弹性伸缩的方法,包括如下执行步骤:
S201、监控第一预设时间内微服务的平均资源使用率。
通过采集第一预设时间内微服务的资源使用率,并计算所述资源使用率的均值,得到平均资源使用率;在一些实施例中,可以设定第一预设时间为5分钟,通过对该时间段内的数据求平均值,得到平均资源使用率。
S202、计算平均资源使用率与预设阈值上限的差值。
比较差值和预设扩容值,预设扩容值是作为预设阈值上限内,且与预设阈值上限相邻的次阈值区域的范围值,通过次阈值区域,作为判断依据,提前为节点扩容进行判定,从而实现在服务扩容时不需要等待就可以直接调度。当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
S203、计算扩容所需资源、监控集群节点资源的剩余节点。
所述扩容所需资源包括pod数以及pod对应规格,监控集群节点资源中剩余节点的情况,并判定所述集群节点资源中剩余节点是否满足扩容所需资源。通过对比扩容所需资源需要的pod数以及pod对应规格与剩余节点,查看剩余节点具有的可用资源是否可以成功调度和执行扩容所需资源包括pod数以及pod对应规格,当不能满足时,即微服务工作负载需求超出了剩余节点容量,此时,需要添加节点来增加集群节点资源的整体可用资源。
S204、根据扩容所需资源计算扩容所需的最小规格。
扩容所需的最小规格是对于新节点的规格要求,节点作为容器集群组成的基本元素,节点取决于业务,每个节点都包含运行pod所需要的基本组成。
S205、发送扩容所需最小规格请求。
S206、从节点资源池中选取满足最小规格的节点作为新节点。
本申请通过节点资源池,提供不同规格的节点资源,便于快捷的实现节点的引入和下线,节约资源成本。从所述节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
由以上技术方案可知,本申请提供一种容器云弹性伸缩的方法,包括获取监控第一预设时间内微服务的平均资源使用率,所述微服务开启HPA;计算平均资源使用率与预设阈值上限的差值,当所述差值小于预设扩容值时,计算扩容所需资源,以及,获取集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;判定所述集群节点资源中剩余节点是否满足扩容所需资源,当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。该方法提前实现节点扩缩容,保证服务扩容时集群具有扩容条件,从而实现两级弹性扩缩容,通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,从而在服务扩容时不需要等待就可以直接调度,更好的满足业务需求,实现快速扩容,在服务流量下降之后自动缩容,节约成本。
如图5所示,本申请提供的部分实施例中,结合另一种具体预设扩容条件,对进行容器云弹性伸缩的方法,包括如下执行步骤:
S301、采集第二预设时间内微服务资源使用率的变化趋势。
S302、根据变化趋势预测下一次资源使用率。
通过采集第二预设时间内的资源使用率,获取所述资源使用率的变化趋势。结合趋势 预测算法,得到下一次的资源使用率。
在一些实施例中,趋势预测算法可以是通过ARIMA模型、神经网络模型、Prophet模型等。
S303、计算下一次资源使用率与预设阈值上限的差值。
比较差值和预设扩容值,预设扩容值是作为预设阈值上限内,且与预设阈值上限相邻的次阈值区域的范围值,通过次阈值区域,作为判断依据,提前为节点扩容进行判定,从而实现在服务扩容时不需要等待就可以直接调度。当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
S304、计算扩容所需资源、监控集群节点资源的剩余节点。
所述扩容所需资源包括pod数以及pod对应规格,监控集群节点资源中剩余节点的情况,并判定所述集群节点资源中剩余节点是否满足扩容所需资源。通过对比扩容所需资源需要的pod数以及pod对应规格与剩余节点,查看剩余节点具有的可用资源是否可以成功调度和执行扩容所需资源包括pod数以及pod对应规格,当不能满足时,即微服务工作负载需求超出了剩余节点容量,此时,需要添加节点来增加集群节点资源的整体可用资源。
S305、根据扩容所需资源计算扩容所需的最小规格。
扩容所需的最小规格是对于新节点的规格要求,节点作为容器集群组成的基本元素,节点取决于业务,每个节点都包含运行pod所需要的基本组成。
S306、发送扩容所需最小规格请求。
S307、从节点资源池中选取满足最小规格的节点作为新节点。
本申请通过节点资源池,提供不同规格的节点资源,便于快捷的实现节点的引入和下线,节约资源成本。从所述节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
由以上技术方案可知,本申请提供一种容器云弹性伸缩的方法,包括采集第二预设时间内微服务资源使用率的变化趋势,所述微服务开启HPA;根据变化趋势预测下一次资源使用率,计算下一次资源使用率与预设阈值上限的差值,当所述差值小于预设扩容值时,计算扩容所需资源,以及,获取集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;判定所述集群节点资源中剩余节点是否满足扩容所需资源,当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。该方法提前实现节点扩缩容,保证服务扩容时集群具有扩容条件,从而实现两级弹性扩缩容,通过自动监控集群状态以及微服务当前资源使用率提前实现扩容节点,从而在服务扩容时不需要等待就可以直接调度,更好的满足业务需求,实现快速扩容,在服务流量下降之后自动缩容,节约成本。
如图6所示,本申请提供的部分实施例中,对于容器云弹性伸缩的集群服务器的任意一个微服务,均开启HPA功能,具备自动伸缩实例的能力。自动伸缩控制器监控内容包括微服务的资源使用率和集群节点资源中剩余节点的情况。应用在装置上的容器云弹性缩容的方法如下:
S101、监控微服务的资源使用率。
相关开启HPA微服务目前的资源使用率,通过判定其资源使用率是否满足预设缩容条件来判断是否进行下一步骤操作,对于不同的资源使用率对应的预设缩容条件也存在差 异。当满足预设缩容条件时,执行如下步骤:
S106、监控集群节点资源的剩余节点。
优先对新节点进行判断,当发现新节点没有相关微服务实例,且微服务没有扩容需求或者目前集群节点资源的剩余节点满足扩容需求,将新节点作为待下线节点。对于其他节点也进行判断,当发现其他节点没有相关微服务实例,将其作为待下线节点。
S107、将没有相关微服务实例对应的节点作为待下线节点,向节点控制器发送下线节点请求。
S108、将待下线节点放回节点资源池。
由以上技术方案可知,本申请提供一种容器云弹性伸缩的方法在服务流量下降之后自动缩容,节约成本。
本申请提供的实施例之间的相似部分相互参见即可,以上提供的具体实施方式只是本申请总的构思下的几个示例,并不构成本申请保护范围的限定。对于本领域的技术人员而言,在不付出创造性劳动的前提下依据本申请方案所扩展出的任何其他实施方式都属于本申请的保护范围。

Claims (10)

  1. 一种容器云弹性伸缩的方法,其特征在于,包括:
    获取微服务的资源使用率,所述微服务开启HPA;
    判定所述微服务的资源使用率是否满足预设扩容条件,当满足预设扩容条件时,计算扩容所需资源,以及,获取集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;
    判定所述集群节点资源中剩余节点是否满足扩容所需资源,当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;
    根据扩容所需的最小规格请求从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
  2. 根据权利要求1所述容器云弹性伸缩的方法,其特征在于,判定所述微服务的资源使用率是否满足预设扩容条件,包括:
    获取第一预设时间内微服务的资源使用率,并计算所述资源使用率的均值,得到平均资源使用率;
    计算所述平均资源使用率与预设阈值上限的差值,当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
  3. 根据权利要求1所述容器云弹性伸缩的方法,其特征在于,判定所述微服务的资源使用率是否满足预设扩容条件,还包括:
    获取第二预设时间内的资源使用率,获取所述资源使用率的变化趋势,根据所述变化趋势预测下一次资源使用率;
    计算下一次资源使用率与预设阈值上限的差值,当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
  4. 根据权利要求1所述容器云弹性伸缩的方法,其特征在于,所述方法还包括:
    判定所述微服务的资源使用率是否满足预设缩容条件,当满足预设缩容条件时,监控所述集群节点资源中剩余节点,将没有相关微服务实例对应的节点作为待下线节点,向节点控制器发送下线节点请求;
    所述节点控制器将所述待下线节点放回所述节点资源池。
  5. 一种容器云弹性伸缩的集群服务器,其特征在于,包括微服务、集群节点资源、自动伸缩控制器、节点控制器和节点资源池;
    所述自动伸缩控制器,用于监控所述微服务和所述集群节点资源,所述微服务开启HPA;
    判定所述微服务的资源使用率是否满足预设扩容条件;
    当满足预设扩容条件时,计算扩容所需资源,以及,监控所述集群节点资源中剩余节点,所述扩容所需资源包括pod数以及pod对应规格;
    判定所述集群节点资源中剩余节点是否满足扩容所需资源;
    当所述剩余节点不满足扩容所需资源,根据所述扩容所需资源计算扩容所需的最小规格;
    向所述节点控制器发送扩容所需的最小规格请求;
    所述节点控制器,响应所述自动伸缩控制器扩容所需的最小规格请求,从所述节点资 源池中选取满足最小规格的节点作为新节点加入所述集群节点资源。
  6. 根据权利要求5所述容器云弹性伸缩的集群服务器,其特征在于,所述预设扩容条件,包括:
    采集第一预设时间内微服务的资源使用率,并计算所述资源使用率的均值,得到平均资源使用率;
    计算所述平均资源使用率与预设阈值上限的差值;
    当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
  7. 根据权利要求5所述容器云弹性伸缩的集群服务器,其特征在于,所述预设扩容条件,还包括:
    采集第二预设时间内的资源使用率,获取所述资源使用率的变化趋势;
    根据所述变化趋势预测下一次资源使用率;
    计算下一次资源使用率与预设阈值上限的差值;
    当所述差值小于预设扩容值时,则资源使用率满足预设扩容条件。
  8. 根据权利要求5所述容器云弹性伸缩的集群服务器,其特征在于:
    所述自动伸缩控制器,还用于判定所述微服务的资源使用率是否满足预设缩容条件;
    当满足预设缩容条件时,监控所述集群节点资源中剩余节点,将没有相关微服务实例对应的节点作为待下线节点,向节点控制器发送下线节点请求;
    所述节点控制器,响应于所述下线节点请求,指定所述待下线节点下线,并将所述待下线节点放回所述节点资源池。
  9. 根据权利要求5所述容器云弹性伸缩的集群服务器,其特征在于,所述装置还包括数据库,所述数据库用于存储节点名称、节点数量以及对应的节点规格。
  10. 根据权利要求9所述容器云弹性伸缩的集群服务器,其特征在于,从节点资源池中选取满足最小规格的节点作为新节点加入所述集群节点资源,包括:
    根据所述数据库,选择所述最小规格适合的节点作为待加入节点;
    对所述待加入节点进行节点初始化,优化所述待加入节点的内核参数;
    调用安装docker脚本,安装docker服务;
    调用安装Kubernetes系统服务脚本安装,并将所述待加入节点加作为新节点加入所述集群节点资源。
PCT/CN2021/128490 2021-06-11 2021-11-03 一种容器云弹性伸缩的方法及集群服务器 WO2022257347A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110651643.2A CN113395178B (zh) 2021-06-11 2021-06-11 一种容器云弹性伸缩的方法及装置
CN202110651643.2 2021-06-11

Publications (1)

Publication Number Publication Date
WO2022257347A1 true WO2022257347A1 (zh) 2022-12-15

Family

ID=77620721

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/128490 WO2022257347A1 (zh) 2021-06-11 2021-11-03 一种容器云弹性伸缩的方法及集群服务器

Country Status (2)

Country Link
CN (1) CN113395178B (zh)
WO (1) WO2022257347A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048814A (zh) * 2023-02-21 2023-05-02 上海汇付支付有限公司 一种基于监控效用数据的应用资源规格自动优化方法
CN116112569A (zh) * 2023-02-23 2023-05-12 安超云软件有限公司 微服务调度方法及管理系统
CN116560818A (zh) * 2023-06-29 2023-08-08 深圳市易图资讯股份有限公司 一种空间数据服务分发与调度的方法及系统
CN116860461A (zh) * 2023-09-04 2023-10-10 深圳大道云科技有限公司 K8s集群的资源调度方法、设备及存储介质
CN116938724A (zh) * 2023-09-19 2023-10-24 广东保伦电子股份有限公司 音视频会议中服务器的扩容与缩容方法

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113395178B (zh) * 2021-06-11 2022-12-09 聚好看科技股份有限公司 一种容器云弹性伸缩的方法及装置
CN116204268A (zh) * 2021-11-30 2023-06-02 华为技术有限公司 一种云实例的扩缩容方法及其相关设备
CN114726734A (zh) * 2022-03-21 2022-07-08 平安壹账通云科技(深圳)有限公司 云服务资源扩容方法、装置、电子设备及存储介质
CN114745277A (zh) * 2022-03-30 2022-07-12 杭州博盾习言科技有限公司 公有云跨域专线的弹性伸缩方法、装置、电子设备及介质
CN115022173B (zh) * 2022-05-10 2023-05-26 度小满科技(北京)有限公司 一种服务扩容的方法、装置、设备及存储介质
CN115037615A (zh) * 2022-06-23 2022-09-09 新华智云科技有限公司 基于云平台的自适应应用扩容方法
CN117687739A (zh) * 2022-09-05 2024-03-12 华为云计算技术有限公司 资源调度方法及其相关设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317638A (zh) * 2014-10-17 2015-01-28 华为技术有限公司 一种应用伸缩管理方法及装置
CN108228347A (zh) * 2017-12-21 2018-06-29 上海电机学院 一种任务感知的Docker自适应调度系统
CN111464355A (zh) * 2020-03-31 2020-07-28 北京金山云网络技术有限公司 Kubernetes容器集群的伸缩容控制方法、装置和网络设备
CN113395178A (zh) * 2021-06-11 2021-09-14 聚好看科技股份有限公司 一种容器云弹性伸缩的方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109428764B (zh) * 2017-09-05 2021-10-15 华为技术有限公司 虚拟网络功能的实例化方法
CN112015515A (zh) * 2019-05-28 2020-12-01 华为技术有限公司 一种虚拟网络功能的实例化方法及装置
CN110262899B (zh) * 2019-06-20 2021-05-11 华云数据控股集团有限公司 基于Kubernetes集群的监控组件弹性伸缩方法、装置及受控终端
CN112540905A (zh) * 2020-12-18 2021-03-23 青岛特来电新能源科技有限公司 一种微服务架构下系统风险评估方法、装置、设备及介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317638A (zh) * 2014-10-17 2015-01-28 华为技术有限公司 一种应用伸缩管理方法及装置
CN108228347A (zh) * 2017-12-21 2018-06-29 上海电机学院 一种任务感知的Docker自适应调度系统
CN111464355A (zh) * 2020-03-31 2020-07-28 北京金山云网络技术有限公司 Kubernetes容器集群的伸缩容控制方法、装置和网络设备
CN113395178A (zh) * 2021-06-11 2021-09-14 聚好看科技股份有限公司 一种容器云弹性伸缩的方法及装置

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048814A (zh) * 2023-02-21 2023-05-02 上海汇付支付有限公司 一种基于监控效用数据的应用资源规格自动优化方法
CN116048814B (zh) * 2023-02-21 2023-10-03 上海汇付支付有限公司 一种基于监控效用数据的应用资源规格自动优化方法
CN116112569A (zh) * 2023-02-23 2023-05-12 安超云软件有限公司 微服务调度方法及管理系统
CN116560818A (zh) * 2023-06-29 2023-08-08 深圳市易图资讯股份有限公司 一种空间数据服务分发与调度的方法及系统
CN116560818B (zh) * 2023-06-29 2023-09-12 深圳市易图资讯股份有限公司 一种空间数据服务分发与调度的方法及系统
CN116860461A (zh) * 2023-09-04 2023-10-10 深圳大道云科技有限公司 K8s集群的资源调度方法、设备及存储介质
CN116860461B (zh) * 2023-09-04 2023-12-19 深圳大道云科技有限公司 K8s集群的资源调度方法、设备及存储介质
CN116938724A (zh) * 2023-09-19 2023-10-24 广东保伦电子股份有限公司 音视频会议中服务器的扩容与缩容方法
CN116938724B (zh) * 2023-09-19 2024-01-30 广东保伦电子股份有限公司 音视频会议中服务器的扩容与缩容方法

Also Published As

Publication number Publication date
CN113395178A (zh) 2021-09-14
CN113395178B (zh) 2022-12-09

Similar Documents

Publication Publication Date Title
WO2022257347A1 (zh) 一种容器云弹性伸缩的方法及集群服务器
US9571347B2 (en) Reactive auto-scaling of capacity
CN110825520B (zh) 一种实现资源高效利用的集群极速弹性伸缩方法
CN112583861B (zh) 服务部署方法、资源配置方法、系统、装置及服务器
CN104010028A (zh) 一种云平台下性能加权的虚拟资源动态管理策略方法
CN109936473B (zh) 基于深度学习预测的分布计算系统及其运行方法
CN113608871A (zh) 业务处理方法及装置
CN113010260A (zh) 容器数量弹性伸缩方法以及容器数量弹性伸缩方法系统
CN116662020B (zh) 应用服务动态管理方法、系统、电子设备及存储介质
CN110647392A (zh) 一种基于容器集群的智能弹性伸缩方法
CN102339233A (zh) 云计算集中管理平台
CN111459681B (zh) 一种基于微服务负载的动态弹性伸缩方法
CN102208986A (zh) 一种集群功耗分配与控制方法
CN111796933A (zh) 资源调度方法、装置、存储介质和电子设备
CN107203256B (zh) 一种网络功能虚拟化场景下的节能分配方法与装置
CN113190329A (zh) 服务器及容器云集群资源自动伸缩的方法
CN109445931A (zh) 一种大数据资源调度系统及方法
CN116643844B (zh) 面向电力超算云资源自动扩展的智能化管理系统及方法
CN108234617A (zh) 一种面向电力系统混合云模式下的资源动态调度方法
CN108667920B (zh) 一种雾计算环境业务流量加速系统及其业务流量加速方法
CN114741200A (zh) 面向数据中台的计算资源分配方法、装置及电子设备
CN110308991A (zh) 一种基于随机任务的数据中心节能优化方法及系统
CN110399216B (zh) 一种整机箱功耗的分配方法、系统、装置及可读存储介质
CN114721810A (zh) 边缘云资源协同调度方法、云管理平台和边缘云节点
WO2022177455A1 (en) Method and system for optimizing resource and traffic management of a computer execution environment in a vran

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21944846

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE