This topic describes how to run a Job by using a virtual node. This method minimizes cluster O&M costs because you do not need to create new nodes in your cluster to handle the peak load.
Background information
- Workloads in the cluster have obvious peak hours and off-peak hours.
- The cluster uses resource pools that consist of elastic container instances to handle traffic spikes and run Jobs. This reduces computing costs to the maximum extent.
In this example, a managed Kubernetes cluster that contains two worker nodes is created. The master nodes are managed by Container Service for Kubernetes (ACK) and are free of charge. The configuration of each worker node is 4 CPU cores and 8 GB of memory. Therefore, the total computing capacity of the cluster is 8 CPU cores and 16 GB of memory. An offline Job that requests 16 CPU cores and 32 GB of memory is deployed to process data. The Job failed to run in the managed Kubernetes cluster because the cluster can provide only 8 CPU cores and 16 GB of memory. The computing resources provided by the cluster do not meet the requirement of the Job. To resolve this issue, you can schedule the Job to a virtual node and run the Job without using the computing resources provided by the nodes in the cluster.
Prerequisites
- A managed Kubernetes cluster is created. For more information, see Create a managed Kubernetes cluster.
- A virtual node is deployed in the cluster. For more information, see Deploy the virtual node controller and use it to create Elastic Container Instance-based pods.
- The alibabacloud.com/eci=true label is added to the vk namespace. For more information, see Create a pod in a namespace with specified labels.
- A kubectl client is connected to the created cluster. For more information, see Connect to ACK clusters by using kubectl.
Procedure
Running a Job on a virtual node can reduce computing costs and O&M workloads. In addition, you do not need to worry about whether the cluster has sufficient computing resources or whether you need to scale the number of nodes.