gke-backup-dr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGKE Backup & Disaster Recovery
GKE备份与灾难恢复
Protects stateful GKE workloads using Backup for GKE.
使用Backup for GKE保护有状态GKE工作负载。
CLI Reference
CLI参考
bash
undefinedbash
undefinedEnable GKE Backup addon (Slow cluster-level update)
启用GKE Backup插件(集群级更新耗时较长)
gcloud container clusters update <CLUSTER_NAME> --enable-gke-backup --region <REGION> --quiet
gcloud container clusters update <CLUSTER_NAME> --enable-gke-backup --region <REGION> --quiet
Create Backup Plan
创建备份计划
gcloud container backup-restore backup-plans create <PLAN_NAME>
--cluster=<CLUSTER_NAME> --location=<REGION>
--retention-days=<DAYS> --cron-schedule="<CRON>" --all-namespaces --quiet
--cluster=<CLUSTER_NAME> --location=<REGION>
--retention-days=<DAYS> --cron-schedule="<CRON>" --all-namespaces --quiet
gcloud container backup-restore backup-plans create <PLAN_NAME>
--cluster=<CLUSTER_NAME> --location=<REGION>
--retention-days=<DAYS> --cron-schedule="<CRON>" --all-namespaces --quiet
--cluster=<CLUSTER_NAME> --location=<REGION>
--retention-days=<DAYS> --cron-schedule="<CRON>" --all-namespaces --quiet
Trigger Manual Backup
触发手动备份
gcloud container backup-restore backups create <BACKUP_NAME>
--backup-plan=<PLAN_NAME> --location=<REGION> --quiet
--backup-plan=<PLAN_NAME> --location=<REGION> --quiet
gcloud container backup-restore backups create <BACKUP_NAME>
--backup-plan=<PLAN_NAME> --location=<REGION> --quiet
--backup-plan=<PLAN_NAME> --location=<REGION> --quiet
Create Restore Plan
创建恢复计划
gcloud container backup-restore restore-plans create <RESTORE_PLAN_NAME>
--cluster=<TARGET_CLUSTER_NAME> --location=<REGION> --backup-plan=<SOURCE_BACKUP_PLAN_NAME>
--cluster-resource-conflict-policy=USE_EXISTING_VERSION --namespaced-resource-restore-mode=FAIL_ON_CONFLICT --quiet
--cluster=<TARGET_CLUSTER_NAME> --location=<REGION> --backup-plan=<SOURCE_BACKUP_PLAN_NAME>
--cluster-resource-conflict-policy=USE_EXISTING_VERSION --namespaced-resource-restore-mode=FAIL_ON_CONFLICT --quiet
gcloud container backup-restore restore-plans create <RESTORE_PLAN_NAME>
--cluster=<TARGET_CLUSTER_NAME> --location=<REGION> --backup-plan=<SOURCE_BACKUP_PLAN_NAME>
--cluster-resource-conflict-policy=USE_EXISTING_VERSION --namespaced-resource-restore-mode=FAIL_ON_CONFLICT --quiet
--cluster=<TARGET_CLUSTER_NAME> --location=<REGION> --backup-plan=<SOURCE_BACKUP_PLAN_NAME>
--cluster-resource-conflict-policy=USE_EXISTING_VERSION --namespaced-resource-restore-mode=FAIL_ON_CONFLICT --quiet
Execute Restore
执行恢复操作
gcloud container backup-restore restores create <RESTORE_NAME>
--restore-plan=<RESTORE_PLAN_NAME> --backup=<BACKUP_NAME> --location=<REGION> --quiet
--restore-plan=<RESTORE_PLAN_NAME> --backup=<BACKUP_NAME> --location=<REGION> --quiet
undefinedgcloud container backup-restore restores create <RESTORE_NAME>
--restore-plan=<RESTORE_PLAN_NAME> --backup=<BACKUP_NAME> --location=<REGION> --quiet
--restore-plan=<RESTORE_PLAN_NAME> --backup=<BACKUP_NAME> --location=<REGION> --quiet
undefinedBest Practices
最佳实践
- CMEK Encryption: Encrypt backup plans using Customer-Managed Encryption
Keys: .
--backup-encryption-key=<KEY> - Scope: Prefer backing up specific namespaces rather than the entire
cluster: .
--included-namespaces=<ns1>,<ns2>
- CMEK加密:使用客户管理的加密密钥(Customer-Managed Encryption Keys)加密备份计划:。
--backup-encryption-key=<KEY> - 备份范围:优先备份特定命名空间而非整个集群:。
--included-namespaces=<ns1>,<ns2>
Troubleshooting & Common Pitfalls (CRITICAL)
故障排查与常见误区(重点)
[!IMPORTANT] Slow Operations: Enabling GKE Backup () triggers a slow Google Cloud control plane cluster update that takes several minutes. * Rule: Do not run a terminal loop waiting for the GKE Backup addon to become active. * Action: Provide the command to enable the addon, explain that the operation will proceed in the background, and immediately proceed to write the backup plan configs. Do not block.--enable-gke-backup
[!IMPORTANT] 操作耗时较长:启用GKE Backup()会触发Google Cloud控制层面的集群更新,该操作耗时数分钟。* 规则:请勿在终端循环等待GKE Backup插件激活。* 操作建议:提供启用插件的命令,说明操作将在后台进行,然后立即着手编写备份计划配置,请勿阻塞流程。--enable-gke-backup