Leader Election Algorithm for Pods in Kubernetes Cluster
Container based virutalization is vastly becoming the standard method for building and deploying applications due to its ease of use and convenience. Kubernetes, a well-known open-source project, offers an orchestration platform for managing containerized applications. Within Kubernetes, applications can be scaled through multiple replicas to ensure high availability and scalability. While stateless applications do not need persistent storage, stateful applications require it to maintain data consistency across replicas. Typically, these applications depend on a leader to manage consistency and coordinate tasks among replicas, resulting in the leader bearing a heavy load. In a Kubernetes cluster, concentrating the leaders of various applications on a single node can create a system bottleneck. This paper proposes a 3leader election algorithm designed to distribute leaders evenly across nodes in the cluster, mitigating the bottleneck issue. We present experimental results demonstrating the correctness and efficiency of our proposed algorithm in comparison to the default leader election algorithm in Kubernetes.Our proposed leader election algorithm operates by keeping a registry of available leaders for various applications on every node within the Kubernetes cluster. When the necessity arises to elect a new leader, nodes engage in communication to equitably distribute the workload, factoring in considerations such as resource usage and network responsiveness.The decentralized distribution of leadership roles throughout the cluster make sure task allocation is more evenly spread, reducing the vulnerability to system risks and strengthening overall flexibility.Adding on , the algorithm includes functionalities for immediate adjustments, enabling the system to promptly adapt to changes in workload and cluster conditions. Long-scaled testing and analysis confirm not only the effectiveness of our approach in resolving bottlenecks but also its seamless integration into existing Kubernetes infrastructures, providing a practical solution for managing stateful applications at scale.
Institutions
- Vignan's Foundation for Science, Technology & Research (IN)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2024-12-24
- DOI
- https://doi.org/10.5281/zenodo.14551378
- Primary Topic
- Genomics and Rare Diseases
- Type
- article
- Field-Weighted Citation Impact
- 0.00