All Products
Search
Document Center

Container Service for Kubernetes:Migrate applications across regions and clusters

Last Updated:Mar 07, 2026

You can use the backup center to back up and restore applications in Kubernetes clusters across different regions. This provides cross-region disaster recovery for your clusters.

Prerequisites

Notes

  • Cross-region application migration supports the backup of applications and their associated volumes that use only Alibaba Cloud disks.

    If you use an ACK dedicated cluster or a registered cluster that is connected to a self-managed Kubernetes cluster on ECS instances, verify that the required permissions for ECS disk snapshots are granted before you use the cross-region recovery feature for disk volumes. For more information, see Install the migrate-controller backup service component and configure permissions.

  • When you back up an application, resources that are being deleted are not backed up.

Preparations

This topic describes how to back up and restore an application across regions and clusters. In this example, an ACK Pro cluster named Cluster_BJ in the China (Beijing) region is used as the backup cluster. An ACK Pro cluster named Cluster_SZ in the China (Shenzhen) region is used as the recovery cluster. The backup repository is associated with an Object Storage Service (OSS) bucket in the China (Beijing) region.

  1. In the China (Beijing) region, create an OSS bucket whose name starts with cnfs-oss-***.

    If an OSS bucket that meets the requirements already exists in this region, you can skip this step.

  2. Run the following command to create a stateful Nginx application in the default namespace of the Cluster_BJ backup cluster.

    YAML file for the stateful Nginx application

    cat << EOF | kubectl apply -f -
    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: web
    spec:
      selector:
        matchLabels:
          app: nginx
      serviceName: "nginx"
      replicas: 1
      template:
        metadata:
          labels:
            app: nginx
        spec:
          containers:
            - name: nginx
              image: nginx:1.14.2
              ports:
                - containerPort: 80
                  name: web
              volumeMounts:
                - name: www
                  mountPath: /usr/share/nginx/html
      volumeClaimTemplates:
        - metadata:
            name: www
            labels:
              app: nginx
          spec:
            accessModes: [ "ReadWriteOnce" ]
            storageClassName: "alicloud-disk-topology-alltype"
            resources:
              requests:
                storage: 20Gi
    EOF

Step 1: Create a backup repository

Note
  • The network access method between a backup repository instance in a cluster and its associated OSS bucket is automatically set. The network access method affects the upload and download speeds of application backups.

    • If the cluster and the OSS bucket are in the same region, PrivateLink is used.

    • If the cluster and the OSS bucket are in different regions, a public network connection is used. You must enable public network access for the cluster to access the public endpoint of OSS. For more information, see Enable public network access for a cluster.

  • You cannot update a backup repository after it is created. You can only delete it. If you delete a backup repository and then create a new one with the same name, the new repository will not work in clusters that used the original backup repository.

The application backup feature uses Alibaba Cloud OSS to store backup data. If no backup repository is available when you create a backup job, you must follow this step to create one. For more information about how to create a backup repository, see Create a backup repository.

Step 2: Back up the application in the Cluster_BJ cluster

For more information about how to back up an application, see Create a backup schedule or an immediate backup.

Important

The cross-region application migration scenario supports only applications that are stateless or use only Alibaba Cloud disks for storage. For other types of stateful applications, do not select Backup Volume during migration to prevent failures during cross-region recovery.

Step 3: Restore the application in the Cluster_SZ cluster

For more information about how to restore an application, see Step 3: Restore applications and volumes.

Step 4: Check if the Nginx application is migrated

  1. Log on to the Container Service Management Console . In the navigation pane on the left, click Clusters.

  2. In the navigation pane on the left of the management page for the Cluster_SZ recovery cluster, choose Workloads > StatefulSets.

  3. Click Details in the Actions column for the Nginx application. Then, click the Pods tab.

    Verify that the status of the application is Running. This indicates that the Nginx application is successfully migrated.

References