Optimizing Cloud Infrastructure Provisioning through Terraformand Genetic Algorithms
Abstract
Modern methodologies like DevOps have increasingly emphasized automation and efficiency in cloud infrastructure management, leading to the widespread adoption of Infrastructure as Code (IaC) and containerization. Kubernetes has become a leading solution for orchestrating containerized applications, automating many tasks traditionally performed manually. Despite its advantages, optimizing resource allocation in complex Kubernetes environments is challenging due to the many configurable options and their intricate dependencies. Genetic algorithms have shown promise in addressing complex optimization problems. This thesis explores the potential of genetic algorithms to optimize Kubernetes-based applications and their underlying infrastructure
To achieve this, a software tool was developed that uses genetic algorithms together with Terraform. The tool deploys several Kubernetes-based applications and their underlying virtual machine infrastructure in parallel. A genetic algorithm is utilized to iteratively evolve and refine the configurations. In addition, experiments were conducted to evaluate the performance of the genetic algorithm-based approach.
The findings of this thesis suggest that genetic algorithms hold potential for optimizing Kubernetes applications and their underlying infrastructure. The results demonstrate that the genetic algorithm-based approach can improve fitness by 34\%, outperforming random configuration selection, which achieved a 22\% improvement. Additionally, the optimization of Kubernetes metrics like memory requests and replica count seem to have the most effect on fitness, while VM metrics like CPU and RAM allocation become more important when resources are limited. The system's design, initially tailored for OpenStack, can be adapted for other cloud environments like AWS, GCP, or Azure with minor adjustments to the Terraform configuration and genetic algorithm parameters.