Gke Backup Dr
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Backup for GKE provides a mechanism to protect stateful workloads running on Google Kubernetes Engine. It captures Kubernetes resource metadata, including manifests and secrets, as well as persistent volume data. The skill facilitates the configuration of the BackupRestore cluster addon, the creation of backup and restore plans, and the execution of recovery workflows. It emphasizes safe restore practices, CMEK encryption, and explicit configuration of volume and secret inclusion to ensure comprehensive workload protection.
What it does
- Enables the BackupRestore cluster addon for GKE clusters.
- Configures backup plans with retention policies and scheduling.
- Supports CMEK-encrypted backups for enhanced security.
- Facilitates the creation and execution of restore plans.
- Provides mechanisms to verify the status of restore operations.
- Offers guidance on managing resource conflicts during restoration.
When to use it
- When implementing a disaster recovery strategy for GKE workloads.
- When you need to perform regular backups of Kubernetes resources and persistent volumes.
- When migrating or seeding workloads between different GKE clusters.
- When you require specific retention policies for cluster backups.
Advantages
- Enables granular control over backup scope, including specific namespaces.
- Supports cross-project backup and restore operations.
- Provides flexible conflict policies to manage resource restoration safely.
- Integrates with GKE CSI drivers for persistent volume snapshots.
Usage examples
- “Enable the BackupRestore addon on my GKE cluster named production-cluster in us-central1.”
- The agent will execute the gcloud command to update the cluster addons, enabling the BackupRestore feature.
- “Create a backup plan for my cluster that includes volume data and secrets, retaining backups for 30 days.”
- The agent will generate and execute the gcloud command to create a backup plan with the specified flags for volume and secret inclusion.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/gke-backup-dr/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip gke-backup-dr.zip -d .agents/skills
Documentation by Google
GKE Backup & Disaster Recovery
Protects stateful GKE workloads using Backup for GKE. Backup for GKE can capture both Kubernetes resource metadata (manifests, configurations, and secrets) and the underlying persistent volume (PV) data — but volume data and secrets are only captured when the backup plan explicitly enables them (see the flags below).
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-backup-dr)"
and append agent-skills/1.0 (skill:gke-backup-dr) to User-Agent headers.
CLI Reference
# Enable the BackupRestore addon (Slow cluster-level update)
gcloud container clusters update {cluster_name} \
--update-addons=BackupRestore=ENABLED --location={location} --quiet
# Create Backup Plan
gcloud beta container backup-restore backup-plans create {plan_name} \
--project={project_id} --location={location} \
--cluster=projects/{project_id}/locations/{location}/clusters/{cluster_name} \
--all-namespaces \
--include-volume-data --include-secrets \
--backup-retain-days={days} --cron-schedule="{cron}" --quiet
# Trigger Manual Backup
gcloud beta container backup-restore backups create {backup_name} \
--backup-plan={plan_name} --location={location} --quiet
# Create Restore Plan
gcloud beta container backup-restore restore-plans create {restore_plan_name} \
--location={location} \
--cluster=projects/{project_id}/locations/{location}/clusters/{target_cluster_name} \
--backup-plan=projects/{project_id}/locations/{location}/backupPlans/{source_backup_plan_name} \
--all-namespaces \
--cluster-resource-conflict-policy=use-existing-version \
--namespaced-resource-restore-mode=fail-on-conflict --quiet
# Execute Restore
gcloud beta container backup-restore restores create {restore_name} \
--restore-plan={restore_plan_name} --location={location} \
--backup=projects/{project_id}/locations/{location}/backupPlans/{source_backup_plan_name}/backups/{backup_name} \
--quiet
# Verify Restore Status
gcloud beta container backup-restore restores describe {restore_name} \
--restore-plan={restore_plan_name} --location={location}[!WARNING]
--include-volume-dataand--include-secretsBOTH DEFAULT TO FALSE. If you omit them, the backup plan silently produces config-only backups with no persistent volume snapshots and no Secrets. Always pass both flags explicitly when the goal is full workload protection.
Notes:
The
backup-restorecommand group requires thegcloud betacomponent (gcloud components install beta).--clusterrequires the full resource pathprojects/{project_id}/locations/{location}/clusters/{cluster_name}(orprojects/{project_id}/zones/{zone}/clusters/{cluster_name}for zonal clusters), not a bare cluster name.Restore plans require exactly one namespaced-resource scope flag:
--all-namespaces,--selected-namespaces={ns1},{ns2},--excluded-namespaces=...,--selected-applications=..., or--no-namespaces.
Restore Safety (CRITICAL)
A restore writes into a live cluster and, depending on the conflict policy, can overwrite or delete existing resources:
--cluster-resource-conflict-policy=use-existing-versionkeeps existing cluster-scoped resources (safe default);use-backup-versiondeletes the existing version first — deleting a CRD deletes all of its CRs.--namespaced-resource-restore-mode=fail-on-conflictaborts on any conflict (safe default);merge-skip-on-conflictskips conflicting resources;merge-replace-on-conflictandmerge-replace-volume-on-conflictoverwrite existing resources or volumes;delete-and-restoredeletes entire conflicting namespaces (and all resources in them) before restoring.
Rules:
Validate the restore in a non-production target cluster first.
Prefer the safe defaults (
use-existing-version+fail-on-conflict) unless the user explicitly needs to revert live resources.Always obtain explicit user confirmation before executing a restore into a production cluster, and state which conflict policy is in effect and what it may overwrite or delete.
Best Practices
CMEK Encryption: Encrypt backup plans using Customer-Managed Encryption Keys:
--encryption-key=projects/{project_id}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}.Scope: Prefer backing up specific namespaces rather than the entire cluster:
--selected-namespaces={ns1},{ns2}(instead of--all-namespaces).Application Consistency: Recommend quiescing the database or pausing application writes (e.g. using pre-backup hooks or database-specific tools) prior to backups to ensure data integrity.
CSI Volume Snapshots: Ensure that stateful backups utilize GKE's CSI (Container Storage Interface) driver for volume snapshots to capture persistent volume data.
Service Terminology: Always explicitly refer to the service as Backup for GKE in your response. This distinguishes it from the broader (but complementary) Google Cloud Backup and Disaster Recovery (DR) Service, ## Golden Path Backup Defaults
The recommended production golden path configuration for Backup for GKE:
Addon: BackupRestore addon enabled (
--update-addons=BackupRestore=ENABLED).Volume Inclusion:
--include-volume-dataexplicitly passed (enabled, since the service default is false).Secret Inclusion:
--include-secretsexplicitly passed (enabled, since the service default is false).Retention: Defined retention period (e.g. 30 days via
--backup-retain-days=30).Encryption: CMEK enabled (
--encryption-key=...).
Recent Changes
Cross-project backup and restore (GA): Backup plans can store backups in a different project than the source cluster, and restore plans can target clusters in a third project. Enables centralized backup projects (with immutability/retention managed by a platform team) and cross-project environment seeding without granting access to the source project.
Pricing change (effective 2026-03-02): The backup management fee moved from pod-based to NAMESPACE-based pricing — charged per non-system namespace in the most recent successful backup of each plan (system namespaces like
kube-systemare excluded). Existing committed use discount (CUD) holders keep pod-based management pricing until their commitment ends; everyone else moves to the new model. See https://cloud.google.com/products/backup-for-gke/pricing-changes.Smart Scheduling: RPO-driven backup scheduling as an alternative to fixed cron schedules — pass
--target-rpo-minutes={minutes}instead of--cron-schedulewhen creating the backup plan (optionally with RPO exclusion windows via--exclusion-windows-file).Hyperdisk support: Backup and restore of Hyperdisk ML and Hyperdisk Balanced High Availability volumes is supported on GKE clusters running 1.33.1-gke.1959000 and later (Hyperdisk throughput, extreme, and balanced types are also supported).
Troubleshooting & Common Pitfalls (CRITICAL)
[!IMPORTANT] Slow Operations: Enabling the BackupRestore addon (
--update-addons=BackupRestore=ENABLED) 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.
Files
- ATTRIBUTION.mdAdded by AutoGineer844 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md8.2 KiB
- references/attribution.md1.8 KiB
SKILL.md
GKE Backup & Disaster Recovery
Protects stateful GKE workloads using Backup for GKE. Backup for GKE can capture both Kubernetes resource metadata (manifests, configurations, and secrets) and the underlying persistent volume (PV) data — but volume data and secrets are only captured when the backup plan explicitly enables them (see the flags below).
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-backup-dr)"
and append agent-skills/1.0 (skill:gke-backup-dr) to User-Agent headers.
CLI Reference
# Enable the BackupRestore addon (Slow cluster-level update)
gcloud container clusters update {cluster_name} \
--update-addons=BackupRestore=ENABLED --location={location} --quiet
# Create Backup Plan
gcloud beta container backup-restore backup-plans create {plan_name} \
--project={project_id} --location={location} \
--cluster=projects/{project_id}/locations/{location}/clusters/{cluster_name} \
--all-namespaces \
--include-volume-data --include-secrets \
--backup-retain-days={days} --cron-schedule="{cron}" --quiet
# Trigger Manual Backup
gcloud beta container backup-restore backups create {backup_name} \
--backup-plan={plan_name} --location={location} --quiet
# Create Restore Plan
gcloud beta container backup-restore restore-plans create {restore_plan_name} \
--location={location} \
--cluster=projects/{project_id}/locations/{location}/clusters/{target_cluster_name} \
--backup-plan=projects/{project_id}/locations/{location}/backupPlans/{source_backup_plan_name} \
--all-namespaces \
--cluster-resource-conflict-policy=use-existing-version \
--namespaced-resource-restore-mode=fail-on-conflict --quiet
# Execute Restore
gcloud beta container backup-restore restores create {restore_name} \
--restore-plan={restore_plan_name} --location={location} \
--backup=projects/{project_id}/locations/{location}/backupPlans/{source_backup_plan_name}/backups/{backup_name} \
--quiet
# Verify Restore Status
gcloud beta container backup-restore restores describe {restore_name} \
--restore-plan={restore_plan_name} --location={location}[!WARNING]
--include-volume-dataand--include-secretsBOTH DEFAULT TO FALSE. If you omit them, the backup plan silently produces config-only backups with no persistent volume snapshots and no Secrets. Always pass both flags explicitly when the goal is full workload protection.
Notes:
The
backup-restorecommand group requires thegcloud betacomponent (gcloud components install beta).--clusterrequires the full resource pathprojects/{project_id}/locations/{location}/clusters/{cluster_name}(orprojects/{project_id}/zones/{zone}/clusters/{cluster_name}for zonal clusters), not a bare cluster name.Restore plans require exactly one namespaced-resource scope flag:
--all-namespaces,--selected-namespaces={ns1},{ns2},--excluded-namespaces=...,--selected-applications=..., or--no-namespaces.
Restore Safety (CRITICAL)
A restore writes into a live cluster and, depending on the conflict policy, can overwrite or delete existing resources:
--cluster-resource-conflict-policy=use-existing-versionkeeps existing cluster-scoped resources (safe default);use-backup-versiondeletes the existing version first — deleting a CRD deletes all of its CRs.--namespaced-resource-restore-mode=fail-on-conflictaborts on any conflict (safe default);merge-skip-on-conflictskips conflicting resources;merge-replace-on-conflictandmerge-replace-volume-on-conflictoverwrite existing resources or volumes;delete-and-restoredeletes entire conflicting namespaces (and all resources in them) before restoring.
Rules:
Validate the restore in a non-production target cluster first.
Prefer the safe defaults (
use-existing-version+fail-on-conflict) unless the user explicitly needs to revert live resources.Always obtain explicit user confirmation before executing a restore into a production cluster, and state which conflict policy is in effect and what it may overwrite or delete.
Best Practices
CMEK Encryption: Encrypt backup plans using Customer-Managed Encryption Keys:
--encryption-key=projects/{project_id}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}.Scope: Prefer backing up specific namespaces rather than the entire cluster:
--selected-namespaces={ns1},{ns2}(instead of--all-namespaces).Application Consistency: Recommend quiescing the database or pausing application writes (e.g. using pre-backup hooks or database-specific tools) prior to backups to ensure data integrity.
CSI Volume Snapshots: Ensure that stateful backups utilize GKE's CSI (Container Storage Interface) driver for volume snapshots to capture persistent volume data.
Service Terminology: Always explicitly refer to the service as Backup for GKE in your response. This distinguishes it from the broader (but complementary) Google Cloud Backup and Disaster Recovery (DR) Service, ## Golden Path Backup Defaults
The recommended production golden path configuration for Backup for GKE:
Addon: BackupRestore addon enabled (
--update-addons=BackupRestore=ENABLED).Volume Inclusion:
--include-volume-dataexplicitly passed (enabled, since the service default is false).Secret Inclusion:
--include-secretsexplicitly passed (enabled, since the service default is false).Retention: Defined retention period (e.g. 30 days via
--backup-retain-days=30).Encryption: CMEK enabled (
--encryption-key=...).
Recent Changes
Cross-project backup and restore (GA): Backup plans can store backups in a different project than the source cluster, and restore plans can target clusters in a third project. Enables centralized backup projects (with immutability/retention managed by a platform team) and cross-project environment seeding without granting access to the source project.
Pricing change (effective 2026-03-02): The backup management fee moved from pod-based to NAMESPACE-based pricing — charged per non-system namespace in the most recent successful backup of each plan (system namespaces like
kube-systemare excluded). Existing committed use discount (CUD) holders keep pod-based management pricing until their commitment ends; everyone else moves to the new model. See https://cloud.google.com/products/backup-for-gke/pricing-changes.Smart Scheduling: RPO-driven backup scheduling as an alternative to fixed cron schedules — pass
--target-rpo-minutes={minutes}instead of--cron-schedulewhen creating the backup plan (optionally with RPO exclusion windows via--exclusion-windows-file).Hyperdisk support: Backup and restore of Hyperdisk ML and Hyperdisk Balanced High Availability volumes is supported on GKE clusters running 1.33.1-gke.1959000 and later (Hyperdisk throughput, extreme, and balanced types are also supported).
Troubleshooting & Common Pitfalls (CRITICAL)
[!IMPORTANT] Slow Operations: Enabling the BackupRestore addon (
--update-addons=BackupRestore=ENABLED) 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.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/gke-backup-dr · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gke-backup-dr.zip