Use an ACK Edge cluster to centrally manage ECS resources in multiple regions
An ACK Edge cluster consolidates compute resources from different regions under a single control plane, enabling full lifecycle management and efficient resource scheduling for cloud-native applications. This topic shows how to use an ACK Edge cluster to manage ECS resources distributed across multiple regions.
Use cases
You can use a single Kubernetes cluster to centrally manage ECS instances and applications in the following scenarios:
-
You have ECS instances in multiple VPCs.
-
You have ECS instances in multiple regions.
-
You have ECS instances across multiple accounts.
Manage applications distributed across multiple regions
If you have a large number of ECS instances scattered across different regions that require centralized management or need to run the same workload, you can add them to an ACK Edge cluster for centralized management. For detailed steps, see Example 1: Use an ACK Edge cluster to manage applications distributed across regions.
-
Security protection
To protect a distributed computing environment from threats like malicious attacks and data breaches, you must often deploy security agents across your resources. An ACK Edge cluster simplifies this by enabling central deployment and management of these agents.
-
Distributed load testing and probing
Large-scale load testing involves initiating tasks from various regions at once, requiring tools to be deployed on geographically distributed resources. You can use an ACK Edge cluster to manage these resources and rapidly deploy testing tools to different regions.
-
Cache acceleration
To accelerate content delivery, distributed caching services are deployed in multiple regions. You can use an ACK Edge cluster to centrally deploy and manage these services.
Address single-region GPU shortages
If you encounter a GPU resource shortage in one region, you can purchase GPU instances from another and add them to your ACK Edge cluster. The cluster can then schedule the task to a suitable GPU instance. For detailed steps, see Example 2: Scale out by adding cross-region GPU instances when GPU resources are insufficient.
Benefits
-
Cost-effective: Reduces O&M costs by providing standard cloud-native interfaces and methods for managing distributed applications.
-
Fully managed: The Kubernetes control plane is hosted by Alibaba Cloud and backed by a service-level agreement (SLA), which frees you from managing the control plane.
-
High availability: Integration with Alibaba Cloud services for elasticity, networking, storage, and observability ensures application stability. The cluster also provides edge autonomy, secure cloud-edge communication channels, and unit-based management to support centralized operations and management of edge resources.
-
High compatibility: Integrates heterogeneous compute resources running on dozens of different operating systems.
-
High performance: Optimized cloud-to-edge communication reduces traffic costs. A single cluster can manage thousands of nodes.
Examples
Example 1: Manage distributed workloads
Prerequisites
-
Select a region to serve as the central region and create an ACK Edge cluster there.
-
Install the OpenKruise component. For more information, see Component management.
-
For each region, create an edge node pool and add the region's ECS instances to it.
Procedure
You can use native or OpenKruise DaemonSets to deploy and manage workloads.
Native DaemonSet
Deployment example
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the DaemonSets page, select a namespace and a deployment method, enter an application name, set Type to DaemonSet, and then follow the on-screen instructions.
For more information about how to deploy a DaemonSet, see Create a DaemonSet workload.
Upgrade workload
On the DaemonSets page, find the target DaemonSet and click Edit in the Actions column. You can edit the DaemonSet template to upgrade the workload version and configuration.
OpenKruise DaemonSet
Deployment example
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the Pods page, click Create from YAML. Select Custom from the Sample Template drop-down list. Copy and paste your deployment YAML into the editor, and then click Create.
Upgrade workload
-
On the Clusters page, click the name of your cluster and choose in the left-side navigation pane.
-
On the Custom Resources page, click Resource Objects and find the DaemonSet. In the Actions column, click Edit YAML. Then, edit the DaemonSet template to upgrade the workload version or configuration.
In the API group tree on the left, find the resource under apps.kruise.io > v1alpha1.
Example 2: Scale out with cross-region GPUs
Prerequisites
You must have an ACK Edge cluster.
Procedure
This example demonstrates how to resolve a GPU resource shortage by adding cross-region GPU instances to an ACK Edge cluster, enabling an inference task to be scheduled successfully.
-
Deploy the inference task and check its status.
-
Create a file named tensorflow-mnist.yaml.
-
Deploy the inference task.
kubectl apply -f tensorflow-mnist.yaml -
Check the status of the inference task.
kubectl get podsExpected output:
NAME READY STATUS RESTARTS AGE tensorflow-mnist-664cf976d8-whrbc 0/1 pending 0 30sThe task's
pendingstatus indicates insufficient GPU resources.
-
-
Create an edge node pool. For more information, see Create an edge node pool.
-
Add the GPU instance as an edge node to the created edge node pool. For more information, see Add a GPU node. In the configuration file for the edge node pool, set the
gpuVersionfield to your GPU model, such asNvidia Tesla A10. The following code block shows a sample configuration file:{ "enableIptables": true, "quiet": true, "manageRuntime": true, "gpuVersion": "Nvidia Tesla A10", "allowedClusterAddons": [ "kube-proxy", "flannel", "coredns" ] } -
Check the status of the edge node.
kubectl get nodesExpected output:
NAME STATUS ROLES AGE VERSION cn-hangzhou.192.168.XX.XX Ready <none> 9d v1.30.7-aliyun.1 iz2ze21g5pq9jbesubr**** Ready <none> 8d v1.30.7-aliyun.1 izf8z0dko1ivt5kwgl4**** Ready <none> 8d v1.30.7-aliyun.1 izuf65ze9db2kfcethw**** Ready <none> 8d v1.30.7-aliyun.1 # The newly added GPU edge node. -
Check the status of the inference task.
kubectl get pods -owideExpected output:
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES tensorflow-mnist-664cf976d8-whrbc 1/1 running 0 23m 10.12.XX.XX izuf65ze9db2kfcethw**** <none> <none>The output shows that the inference task was scheduled to the new GPU node and is now running.