Use an ACK Edge cluster to centrally manage ECS resources in multiple regions

Updated at:

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

Procedure

You can use native or OpenKruise DaemonSets to deploy and manage workloads.

Native DaemonSet

Deployment example
  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > DaemonSets.

  3. 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
  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Pods.

  3. 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
  1. On the Clusters page, click the name of your cluster and choose Workloads > Custom Resources in the left-side navigation pane.

  2. 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.

  1. Deploy the inference task and check its status.

    1. Create a file named tensorflow-mnist.yaml.

      Click to view the tensorflow-mnist.yaml file

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: tensorflow-mnist
        labels:
          app: tensorflow-mnist
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: tensorflow-mnist
        template:
          metadata:
            name: tensorflow-mnist
            labels:
              app: tensorflow-mnist
          spec:
            containers:
            - name: tensorflow-mnist
              image: registry.cn-beijing.aliyuncs.com/acs/tensorflow-mnist-sample:v1.5
              command:
              - python
              - tensorflow-sample-code/tfjob/docker/mnist/main.py
              - --max_steps=100000
              - --data_dir=tensorflow-sample-code/data
              resources:
                limits:
                  nvidia.com/gpu: "1"
                requests:
                  nvidia.com/gpu: "1"
              workingDir: /root
    2. Deploy the inference task.

      kubectl apply -f tensorflow-mnist.yaml
    3. Check the status of the inference task.

      kubectl get pods

      Expected output:

      NAME                                 READY   STATUS     RESTARTS   AGE
      tensorflow-mnist-664cf976d8-whrbc    0/1     pending    0          30s

      The task's pending status indicates insufficient GPU resources.

  2. Create an edge node pool. For more information, see Create an edge node pool.

  3. 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 gpuVersion field to your GPU model, such as Nvidia 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"
      ]
    }
  4. Check the status of the edge node.

    kubectl get nodes

    Expected 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.
  5. Check the status of the inference task.

    kubectl get pods -owide

    Expected 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.