电子科技 ›› 2025, Vol. 38 ›› Issue (3): 32-39.doi: 10.16180/j.cnki.issn1007-7820.2025.03.005

• • 上一篇    下一篇

Kubernetes容器云的弹性伸缩方法

李佳颖(), 杨泽民, 宋哲代, 朱金荣   

  1. 扬州大学 物理科学与技术学院,江苏 扬州225000
  • 收稿日期:2023-08-31 修回日期:2023-09-19 出版日期:2025-03-15 发布日期:2025-03-11
  • 通讯作者: 李佳颖(2000-),男,E-mail:coolikain@gmail.com,硕士研究生。研究方向:物联网与云计算。
  • 作者简介:朱金荣(1968-),男,教授。研究方向:物联网与云计算。
  • 基金资助:
    国家自然科学基金(61802336)

Research on Elastic Scaling Method of Kubernetes Container Cloud

LI Jiaying(), YANG Zemin, SONG Zhedai, ZHU Jinrong   

  1. School of Physical Sciences and Technology,Yangzhou University,Yangzhou 225000,China
  • Received:2023-08-31 Revised:2023-09-19 Online:2025-03-15 Published:2025-03-11
  • Supported by:
    National Natural Science Foundation of China(61802336)

摘要:

Kubernetes容器云是当前流行的云计算技术,其默认的弹性伸缩方法HPA(Horizontal Pod Autoscaler)能对云原生应用进行横向扩缩容。但该方法存在以下问题:基于单一负载指标,使其难以适用于多样化云原生应用;基于当前负载进行弹性伸缩,使扩缩容过程具有明显的滞后性;基于滑动时间窗口算法进行弹性缩容,使缩容过程缓慢易造成系统资源浪费。针对上述问题,文中提出一种改进的弹性伸缩方法。设计一种动态加权融合算法将多种负载指标融合为综合负载因子,全面反映云原生应用的综合负载。提出CEEMDAN(Complete Ensemble Empirical Mode Decomposition with Adaptive Noise)-ARIMA(Autoregressive Integrated Moving Average Model)预测模型,基于该模型的预测负载值实现预先弹性伸缩以应对突发流量。提出快速缩容与滑动时间窗口相结合的方法,在确保应用服务质量的基础上减少系统资源浪费。实验结果表明,相较于HPA机制,改进的弹性伸缩方法在应对首次突发流量时的平均响应时间缩短了336.55%,流量结束后系统资源占用减少了50%,再次遇到突发流量时能迅速扩容,平均响应时间缩短66.83%。

关键词: 云计算, 容器云, Kubernetes, HPA, 弹性伸缩, 时间序列, 滑动窗口, 加权融合, 负载预测

Abstract:

Kubernetes container cloud is currently a popular cloud computing technology, and its default elastic scaling method HPA(Horizontal Pod Autoscaler) can horizontally expand and shrink cloud native applications.However, this method is based on a single load index, which is difficult to apply to diversified cloud-native applications. In addition, the method performs elastic expansion based on the current load, so that the process of expansion and contraction has obvious hysteresis. This method is based on the sliding time window algorithm for elastic shrinkage, which is slow and easy to waste system resources.To solve these problems, an improved elastic stretching method is proposed in this paper. A dynamic weighted fusion algorithm is designed to fuse multiple load indicators into comprehensive load factors, which can fully reflect the comprehensive load of cloud native applications.CEEMDAN(Complete Ensemble Empirical Mode Decomposition with Adaptive Noise)-ARIMA(Autoregressive Integrated Moving Average Model) prediction model is proposed, and elastic expansion is realized in advance to cope with the burst traffic based on the predicted load value of the model.A method combining rapid capacity reduction and sliding time window is proposed to reduce system resource waste on the basis of ensuring application service quality.Experimental results show that compared with the HPA mechanism, the improved elastic scaling method shortens the average response time by 336.55% when dealing with the first burst traffic, reduces system resource usage by 50% after the traffic ends, and can quickly expand the capacity when encountering burst traffic again, with an average response time shortened by 66.83%.

Key words: cloud computing, container cloud, Kubernetes, HPA, auto scaling, time series, sliding window, weighted fusion, load forecasting

中图分类号: 

  • TP301.6