
Skill
gke-backup-dr
configure GKE backup and disaster recovery
Description
Workflows for configuring Backup for GKE and disaster recovery.
SKILL.md
GKE Backup & Disaster Recovery Skill
This skill provides workflows for protecting your stateful workloads on GKE using Backup for GKE.
Workflows
1. Enable Backup for GKE
Backup for GKE must be enabled on the cluster level.
Command:
gcloud container clusters update <cluster-name> \
--enable-gke-backup \
--region <region>
2. Create a Backup Plan
A Backup Plan defines what to back up, when, and for how long.
Command to create a backup plan:
gcloud container backup-restore backup-plans create <plan-name> \
--cluster=<cluster-name> \
--region=<region> \
--retention-days=<days> \
--cron-schedule="<cron-expression>" \
--all-namespaces
!NOTE You can replace
--all-namespaceswith--included-namespaces=<namespace1>,<namespace2>to back up specific namespaces instead of all of them.
Encryption Note: You can specify a Customer-Managed Encryption Key (CMEK) to encrypt backups. Add --backup-encryption-key=<key-resource-name> to the create command.
3. Create a Manual Backup
Trigger a backup immediately outside the schedule.
Command:
gcloud container backup-restore backups create <backup-name> \
--backup-plan=<plan-name> \
--region=<region>
4. Restore from Backup
Restore a workload or cluster from a backup.
Command to create a restore plan:
gcloud container backup-restore restore-plans create <restore-plan-name> \
--cluster=<target-cluster-name> \
--region=<region> \
--backup-plan=<source-backup-plan-name> \
--cluster-resource-conflict-policy=USE_EXISTING_VERSION \
--namespaced-resource-restore-mode=FAIL_ON_CONFLICT
Execute the restore:
gcloud container backup-restore restores create <restore-name> \
--restore-plan=<restore-plan-name> \
--backup=<backup-name> \
--region=<region>
Best Practices
- Automate Backups: Always use a cron schedule for production workloads.
- Test Restores: Regularly test restoring backups to a separate namespace or cluster to ensure data integrity.
- Cross-Region DR: Consider storing backups in a different region or setting up a cross-region restore plan for disaster recovery.
- Secure Backups: Use Customer-Managed Encryption Keys (CMEK) to encrypt backups for compliance and security.
More skills from the gke-mcp repository
View all 25 skillscustom-golden-image-discovery
discover golden base images for GKE nodes
Jul 12DeploymentGoogle CloudKubernetesgke-ai-troubleshooting-handle-disruption-gpu-tpu
diagnose GPU and TPU workload disruptions
Jul 28DebuggingGoogle CloudKubernetesPerformancegke-ai-troubleshooting-jobset-interruption
diagnose GKE JobSet interruptions
Jul 12DebuggingGoogle CloudKubernetesObservabilitygke-ai-troubleshooting-skill-creation-guide
create GKE troubleshooting skill bundles
Jul 12DocumentationEngineeringGoogle CloudTechnical Writinggke-ai-troubleshooting-tpu-connection-failure-vbar-oom
diagnose GKE TPU connection failures
Jul 12DebuggingGoogle CloudKubernetesPerformancegke-app-onboarding
containerize and deploy apps to GKE
Jul 12ContainersDeploymentGoogle CloudKubernetes +1
More from Google Cloud
View publisherkb-search
search and extract local knowledge base documents
knowledge-catalog
Jul 12DocumentationKnowledge BaseSearchknowledge_catalog_discovery_agent
search and rank Knowledge Catalog data entries
knowledge-catalog
Jul 12Data AnalysisGoogle CloudKnowledge ManagementSearchcontributing
contribute to Cloud Foundation Fabric
cloud-foundation-fabric
Jul 31AutomationEngineeringGitHubGoogle Cloud +1fabric-builder
generate Terraform code for Google Cloud
cloud-foundation-fabric
Jul 12Google CloudInfrastructure as CodeTerraformfast-0-org-setup-prereqs
prepare prerequisites for FAST 0-org-setup
cloud-foundation-fabric
Jul 12Google CloudOperationsagent-aware-cli
design agent-aware command-line interfaces
vertex-ai-creative-studio
Jul 12CLIEngineeringGoogle Cloud