Adaptive Resource Allocation for Workflow Containerization on Kubernetes

Chenggang Shan, Chuge Wu, Yuanqing Xia, Zehua Guo, Danyang Liu, Jinhui Zhang · DOI

Abstract

Scientific workflows, characterized by complex Directed Acyclic Graph (DAG) structures, are increasingly deployed on Kubernetes. However, existing workflow engines often struggle with resource allocation, leading to either costly over-provisioning or performance-degrading under-provisioning. This paper presents the Adaptive Resource Allocation Scheme (ARAS), a plug-and-play component for the KubeAdaptor engine. ARAS utilizes a MAPE-K feedback loop to dynamically scale container resources based on real-time cluster states and predicted task demands. Experimental results across diverse scientific workflows demonstrate that ARAS can reduce execution times by up to 80% while significantly improving CPU and memory utilization.

Introduction

The execution of large-scale scientific workflows in fields such as genomics and astronomy requires robust orchestration. Kubernetes (K8s) has become the de facto standard for these cloud-native workloads. Despite its popularity, K8s workflow engines often exhibit "short-sighted" allocation logic, making decisions based solely on immediate load without considering the broader workflow lifecycle. This leads to the "Goldilocks" problem: over-provisioning wastes expensive cloud resources, while under-provisioning causes "Out of Memory" (OOM) failures and slow execution.

System Architecture: KubeAdaptor

To address these challenges, the authors developed KubeAdaptor, a workflow engine designed for high-density containerized task execution. The architecture consists of several modular components that decouple workflow logic from resource management.

The overall architecture of KubeAdaptor and its interaction with a Kubernetes cluster.

As shown in the architecture, the Workflow Injection Module parses and packages incoming DAGs. The Containerized Workflow Builder serves as the core, housing the Interface Unit, Containerized Executor, and the Resource Manager. A key component is the Informer, which maintains a local cache of the K8s cluster state, allowing for low-latency resource discovery without overloading the API server.

The ARAS Mechanism

The heart of the system is the Adaptive Resource Allocation Scheme (ARAS), which implements a MAPE-K (Monitor-Analyze-Plan-Execute Knowledge) loop. This model enables autonomic resource management by continuously adjusting container quotas.

The MAPE-K feedback loop integrated within the KubeAdaptor framework.

1. Monitoring and Analysis

The system monitors remaining resources and workflow status via the Informer and Redis database. Unlike static allocators, ARAS evaluates the potential future task requests within a pod's lifecycle.

2. Planning and Execution

ARAS employs a resource scaling strategy that calculates the "just right" allocation. A critical innovation is the introduction of the α factor (typically set to 0.8). This proportional value ensures that only 80% of available resources are allocated to a task, leaving a buffer to prevent resource starvation for other system processes.

3. Vertical Autoscaling and Self-Healing

Instead of horizontal scaling (adding pods), ARAS focuses on vertical scaling—adjusting the resource limits of existing containers. Furthermore, the system includes a self-healing mechanism: if a task fails due to an OOM event, ARAS detects the failure, re-evaluates the resource requirements, and re-executes the task with an adjusted quota.

Experimental Evaluation

The effectiveness of ARAS was evaluated using four benchmark scientific workflows from the Pegasus repository: Montage (astronomy), Epigenomics (genomics), CyberShake (seismology), and LIGO (physics). These were tested under three arrival patterns: Constant, Linear, and Pyramid (bursty).

Key Results

Compared to a standard First-Come-First-Serve (FCFS) baseline, ARAS delivered significant performance gains:

  • Execution Time: Total workflow duration was reduced by 9.8% to 40.92%. For individual workflows, the reduction reached as high as 79.86%.
  • Resource Efficiency: CPU and memory utilization rates increased by 1% to 16%, indicating that performance gains were achieved through better efficiency rather than simply increasing hardware capacity.
  • Robustness: The system successfully handled simulated OOM errors through its automated re-evaluation and re-execution logic.

Conclusion and Future Work

ARAS demonstrates that lifecycle-aware, dynamic resource allocation can drastically improve the efficiency of containerized scientific workflows. By modularizing the resource management logic, the authors have created a flexible framework for cloud-native orchestration. Future research will explore the integration of Deep Reinforcement Learning (DRL) to replace heuristic scaling and investigate strategies for cloud-edge cooperative environments where hardware heterogeneity and network latency present additional challenges.

Summary updated

BibTeX
@article{shan2023adaptive,
  author = {Chenggang Shan and Chuge Wu and Yuanqing Xia and Zehua Guo and Danyang Liu and Jinhui Zhang},
  title = {{Adaptive Resource Allocation for Workflow Containerization on Kubernetes}},
  journal = {Journal of Systems Engineering and Electronics},
  year = {2023},
  doi = {10.23919/jsee.2023.000073},
}
Figure