摘要
近几年,基于容器的虚拟化应用技术发展迅速,Kubernetes已经成为容器编排领域的事实标准,其自身的HPA控制器能够自动实现pod的水平伸缩。但Kubernetes本身的伸缩策略是一种响应式策略,pod的水平扩容存在延迟,在这期间将不可避免地会出现响应延迟或响应失败。为改善上述问题,文中设计一种基于预测值的扩容方案,其中的预测算法采用KNG模型。KNG模型是基于Kalman⁃NeuralProphet⁃GRU组合模型优化而来,并对其做出适当的扩展与改动,以更好地适应预测需要。所设计的扩容方案首先使用KNG模型来预测pod的资源使用情况;然后将预测值送入HPA控制器,以计算出所需的pod副本数。实验结果表明,预测算法能够较为准确地预测到pod负载的变化,使HPA控制器能够以预测值为依据,提前完成pod副本数的扩充,从而提高应用在流量高峰初始阶段的响应能力。
In recent years,container⁃based virtualization application technology has developed rapidly.Kubernetes has become the de facto standard in the field of container orchestration,and its own HPA controller can automatically achieve horizontal scaling of pod.However,the scaling strategy of Kubernetes is a responsive strategy.There is a delay in the horizontal expansion of pod.During this period,response delays or even response failures will inevitably occur.In order to improve this problem,an expansion scheme based on prediction value is designed,and the prediction algorithm adopts the KNG model.The model is optimized based on the Kalman⁃NeuralProphet⁃GRU combined model,and the appropriate extensions and changes are made to it to better meet the forecasting needs.In the designed expansion scheme,the KNG model is first used to predict the resource usage of the pod,and then the predicted value is fed into the HPA controller to calculate the required number of pod replicas.The experimental results show that the predicted algorithm can more accurately predict the change of pod load,and HPA can complete the expansion of pod replica number in advance based on the predicted value,so as to improve the responsiveness of the application in the initial stage of traffic peak.
作者
杜金涛
董建刚
承华青
DU Jintao;DONG Jiangang;CHENG Huaqing(Xinjiang University,Urumqi 830008,China)
出处
《现代电子技术》
2023年第10期129-136,共8页
Modern Electronics Technique
基金
新疆维吾尔自治区科技厅项目(2020E01023)。