G

gke-backup-dr

by @googlev
4.5(120)

GKEのステートフルワークロードをBackup for GKEで自動保護します。Kubernetesリソースメタデータと永続ボリュームデータを取得し、保持期間指定のバックアップ計画作成、手動トリガー、コンフリクトポリシー設定可能な復元を実行。本番環境でのデータ整合性確保と迅速な災害復旧を実現し、CMEK暗号化やCSIスナップショットなどのベストプラクティスも提供します。

gkebackupdisaster-recoverykubernetesgcpGitHub
インストール方法
npx skills add https://github.com/google/skills --skill gke-backup-dr
compare_arrows

Before / After 効果比較

1 组
使用前

このスキルがない場合、ユーザーは手動で複雑なスクリプトを作成してGKEのステートフルワークロードをバックアップ・復元する必要があり、名前空間や永続ボリュームなどのリソース管理が煩雑で、復元に60分以上かかり、データ整合性の確保が困難でした。

使用後

このスキルはBackup for GKEを利用してKubernetesリソースメタデータと永続ボリュームデータを自動取得し、ワンクリックでバックアップ計画作成と復元を実行。復元時間を10分に短縮し、CSIスナップショットとアプリケーション静止化によりデータ整合性を保証します。

SKILL.md

GKE Backup & Disaster Recovery

Protects stateful GKE workloads using Backup for GKE. Backup for GKE natively captures both Kubernetes resource metadata (manifests, configurations, and secrets) and the underlying persistent volume (PV) data.

CLI Reference

# Enable GKE Backup addon (Slow cluster-level update)
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

# Trigger Manual Backup
gcloud container backup-restore backups create <BACKUP_NAME> \
  --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

# Execute Restore
gcloud container backup-restore restores create <RESTORE_NAME> \
  --restore-plan=<RESTORE_PLAN_NAME> --backup=<BACKUP_NAME> --location=<REGION> --quiet

# Verify Restore Status
gcloud container backup-restore restores describe <RESTORE_NAME> --location=<REGION>

Best Practices

  1. CMEK Encryption: Encrypt backup plans using Customer-Managed Encryption Keys: --backup-encryption-key=<KEY>.
  2. Scope: Prefer backing up specific namespaces rather than the entire cluster: --included-namespaces=<ns1>,<ns2>.
  3. 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.
  4. CSI Volume Snapshots: Ensure that stateful backups utilize GKE's CSI (Container Storage Interface) driver for volume snapshots to capture persistent volume data.
  5. 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, as Backup for GKE is built specifically for GKE.

Troubleshooting & Common Pitfalls (CRITICAL)

[!IMPORTANT] Slow Operations: Enabling GKE Backup (--enable-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.

ユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数6.5K
評価4.5 / 5.0
バージョン
更新日2026年10月24日
比較事例1 件

ユーザー評価

4.5(120)
5
37%
4
43%
3
13%
2
5%
1
2%

この Skill を評価

0.0

対応プラットフォーム

🤖claude-code

タイムライン

作成2026年7月26日
最終更新2026年10月24日
🎁 Agent 知識カード
アンケート