Cloud Native 10 min read

Alibaba Cloud ACK Backup Center: Kubernetes Disaster Recovery and Migration with Resource Adjustment Strategies

This article explains how Alibaba Cloud ACK Backup Center simplifies Kubernetes disaster recovery and cross‑cluster migration by offering automated resource‑adjustment policies, detailed backup and restore workflows, and a step‑by‑step best‑practice example for migrating a stateful application with custom YAML configurations.

Alibaba Cloud Infrastructure
Alibaba Cloud Infrastructure
Alibaba Cloud Infrastructure
Alibaba Cloud ACK Backup Center: Kubernetes Disaster Recovery and Migration with Resource Adjustment Strategies

In the rapidly evolving cloud‑native landscape, backing up and migrating Kubernetes (K8s) clusters present significant challenges, especially when environment differences require manual resource adjustments that increase operational complexity and prolong recovery time.

ACK Backup Center addresses these pain points by providing a rich set of resource‑adjustment strategies that automatically adapt restored resources to the target cluster. The strategies are divided into three categories: Default Modification (automatic changes such as UID removal, API version upgrades, and cross‑cloud compatibility), Common Modification (simple mappings for namespaces, storage classes, and image registries), and Generic Modification (flexible JSON‑patch operations via Velero’s resource‑modifier ConfigMap).

The backup workflow consists of three steps: Backup (create periodic or one‑time application backups with namespace, label, and resource‑type filters), optional Resource Adjustment Strategy definition, and Restore (apply the selected strategy during recovery).

The article then presents a best‑practice scenario that migrates a stateful Nginx application from a self‑built K8s cluster to an ACK cluster. The process includes registering the cluster with ACK One, installing the migrate-controller component, creating a backup, defining a custom resource‑modifier ConfigMap to delete node affinity, and restoring the application with namespace and image‑registry mappings.

Key YAML examples are provided:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: web
  namespace: default
  labels:
    app: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  serviceName: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: is_idc
                operator: Exists
      containers:
      - name: nginx
        image: anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6
        ports:
        - containerPort: 80
        volumeMounts:
        - name: www
          mountPath: /usr/share/nginx/html/
  volumeClaimTemplates:
  - metadata:
      name: www
    spec:
      accessModes: ["ReadWriteOnce"]
      resources:
        requests:
          storage: 20Gi
      storageClassName: alicloud-disk-topology-alltype
apiVersion: csdr.alibabacloud.com/v1beta1
kind: ApplicationBackup
metadata:
  name:
namespace: csdr
spec:
  backupType: AppAndPvBackup
  includedNamespaces:
  - default
  pvBackup:
    defaultPvBackup: true
  storageLocation:
ttl: 720h0m0s
apiVersion: v1
data:
  modifier: |
    version: v1
    resourceModifierRules:
    - conditions:
        groupResource: statefulsets.apps
        namespaces:
        - default
        labelSelector:
          matchLabels:
            app: nginx
      patches:
      - operation: remove
        path: "/spec/template/spec/affinity/nodeAffinity"
    - conditions:
        groupResource: pods
        resourceNameRegex: "^web.*$"
        namespaces:
        - default
        labelSelector:
          matchLabels:
            app: nginx
      patches:
      - operation: remove
        path: "/spec/affinity"
kind: ConfigMap
metadata:
  name:
-resource-modifier
  namespace: csdr
apiVersion: csdr.alibabacloud.com/v1beta1
kind: ApplicationRestore
metadata:
  name:
namespace: csdr
spec:
  backupName:
namespaceMapping:
    default: default1
  imageRegistryMapping:
    anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis: registry.cn-beijing.aliyuncs.com/
resourceModifier:
    kind: ConfigMap
    name:
-resource-modifier

After the restore completes, the application runs in the target ACK cluster with the new namespace, updated image registry, and removed node affinity, confirming that ACK Backup Center’s flexible adjustment policies enable seamless migration and high‑availability disaster recovery.

In summary, ACK Backup Center’s automated resource‑adjustment mechanisms effectively mitigate environment‑difference issues during Kubernetes backup and migration, ensuring smooth business continuity across cloud‑native deployments.

Migrationcloud-nativeKubernetesdisaster recoveryBackupAckResource Adjustment
Alibaba Cloud Infrastructure
Written by

Alibaba Cloud Infrastructure

For uninterrupted computing services

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.