MIGRATION OF SERVICES IN A KUBERNETES CLUSTER BASED ON WORKLOAD FORECASTING

2024;
: 82-92
1
Lviv Polytechnic National University
2
Lviv Polytechnic National University

The article delves into the intricate challenge of scaling microservices within a Kubernetes cluster, thoroughly examining existing methodologies for scaling microservice architectures, and presenting a novel approach that involves migrating specific components. Unlike the conventional horizontal and vertical scaling strategies, which require additional resources, this proposed method focuses on migrating non-critical components to another Kubernetes cluster. This migration effectively frees up resources in the cluster experiencing increased load without necessitating extra resources, thus significantly reducing maintenance costs through lower server rental expenses. Furthermore, a detailed comparative analysis of reactive and proactive decision-making approaches for system scaling was conducted, with a preference shown for the proactive approach. Unlike the reactive method, where scaling is a response to an increase in load, the proactive approach relies on forecasted data to make scaling decisions before the actual load rises, thereby maintaining a high quality of service (QoS). To identify the most optimal load forecasting method, various models were reviewed and practically compared, including ARIMA, Prophet, and LSTM models. ARIMA was ultimately selected for implementing the proposed approach, realized as a Docker container with a Python application. This application retrieves system data from the Prometheus database and utilizes the ARIMA model for forecasting. Post-forecasting, it updates the deployment configuration files for ArgoCD and commits the changes to a Git repository. Once the updated configuration files are pushed to the Git repository, ArgoCD fetches the new configuration, compares it with the current deployment, and if there are discrepancies, automatically adjusts the infrastructure to the desired state. This approach not only optimizes resource usage within the Kubernetes cluster but also maintains high performance without incurring additional costs.

[1]   S. J. Taylor and B. Letham, “Forecasting at scale” in The American Statistician, vol. 72, no. 1, pp. 37-45, 2018, doi: 10.1080/00031305.2017.1380080.

[2]   J. Hamilton, “Time Series Analysis” Princeton University Press, 1994, ISBN: 9780691042893.

[3]   B. Billah, M. King, R. Snyder, and A. Koehler, “Exponential smoothing model selection for forecasting” International Journal of Forecasting, vol. 22, pp. 239-247, 2006, doi: 10.1016/j.ijforecast.2006.03.005.

[4]   B. Billah, M. King, R. Snyder, and A. Koehler, “Forecasting time series using a methodology based on autoregressive integrated moving average and genetic programming” 2006.

[5]   A. Graves, “Long Short-Term Memory” Neural Networks, vol. 32, pp. 231-247, 2012, doi: 10.1016/j.neunet.2012.02.019.

[6]   C. Beneditto, A. Satrio, W. Darmawan, B. Unrica, and N. Hanafiah, “Time series analysis and forecasting of coronavirus disease in Indonesia using ARIMA model and PROPHET” 2021.

[7]   R. Shumway and D. Stoffer, “ARIMA Models” Springer, 2017, doi: 10.1007/978-3-319-52452-8.

[8]   F. Beetz and S. Harrer, “GitOps: The Evolution of DevOps?” 2021.

[9]   2B. Yuen, A. Matyushentsev, T. Ekenstam, and J. Suen, “GitOps and Kubernetes: Continuous Deployment with Argo CD, Jenkins X, and Flux” O'Reilly Media, 2021, ISBN: 978-1492094317.

[10]B. Yuen, A. Matyushentsev, T. Ekenstam, and J. Suen, “Forecasting Time Series Data with Facebook Prophet” Packt Publishing, 2021, ISBN: 978-1838982461.