jpskill.com
🛠️ 開発・MCP コミュニティ

gcp-waf-reliability

Google Cloudの信頼性に関する設計原則に基づき、可用性を高めるための設定、監視、障害対応などを実施し、本番環境の準備やSREプラクティスに役立てるSkill。

📜 元の英語説明(参考)

Apply the Google Cloud Well-Architected Framework's Reliability pillar — define user-centric SLOs, eliminate single points of failure with multi-zone/region redundancy, configure horizontal autoscaling, observability via Cloud Monitoring, graceful degradation patterns, DR testing, and blameless postmortems. Use for production readiness reviews and SRE practices.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Google Cloudの信頼性に関する設計原則に基づき、可用性を高めるための設定、監視、障害対応などを実施し、本番環境の準備やSREプラクティスに役立てるSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o gcp-waf-reliability.zip https://jpskill.com/download/14935.zip && unzip -o gcp-waf-reliability.zip && rm gcp-waf-reliability.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14935.zip -OutFile "$d\gcp-waf-reliability.zip"; Expand-Archive "$d\gcp-waf-reliability.zip" -DestinationPath $d -Force; ri "$d\gcp-waf-reliability.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して gcp-waf-reliability.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → gcp-waf-reliability フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

GCP Well-Architected Framework — 信頼性

概要

信頼性は、インフラストラクチャの稼働時間ではなく、ユーザーエクスペリエンスによって測定されます。システムがインフラストラクチャのダッシュボード上で100%正常であっても、ユーザーがチェックアウトの失敗を目にする可能性があります。これは、SLOが埋めるべきギャップです。このスキルでは、Google Cloud Well-Architected Framework の信頼性の柱を適用して、本番環境のワークロードを設計、評価、強化します。

手順

コア原則

原則 意味
ユーザーエクスペリエンスを通じて信頼性を定義する CPU/ディスクだけでなく、ユーザーが感じるものを測定する(リクエストの成功率、レイテンシのp99、ページロード時間)
現実的な SLO ターゲットを設定する 99.9% はおおよそ 43 分/月のエラーバジェット、99.99% は 4 分です。ビジネスで実際に必要なものを選択してください
冗長性を構築する 単一のゾーン、リージョン、またはサービスがユーザーエクスペリエンスを低下させるべきではありません
水平方向にスケールする より大きなインスタンスではなく、より多くのインスタンスを使用します。これはフォールトトレランスでもあります
オブザーバビリティを通じて検出する メトリクス + ログ + トレース。原因ではなく、ユーザーに影響を与える症状についてアラートを発する
グレースフルに劣化させる 読み取り専用モード、キャッシュされた応答、キューアンドリトライは、ハードウェア障害よりも優れています
障害復旧をテストする フェイルオーバー、バックアップからの復元、リージョンからの退避を練習する
非難しないポストモーテム 人為的エラーを許容したシステム上の欠陥を文書化する

SLI と SLO の定義

# SLO 定義の例 (gcloud または Terraform で管理)
# SLI: ロードバランサーからの HTTP 成功率
# SLO: ローリング 28 日間でリクエストの 99.9% が成功
displayName: "Web frontend availability"
serviceLevelIndicator:
  requestBased:
    goodTotalRatio:
      goodServiceFilter: |
        metric.type="loadbalancing.googleapis.com/https/request_count"
        resource.labels.url_map_name="web-frontend"
        metric.labels.response_code_class="200"
      totalServiceFilter: |
        metric.type="loadbalancing.googleapis.com/https/request_count"
        resource.labels.url_map_name="web-frontend"
goal: 0.999
rollingPeriod: 2419200s  # 28 days
# gcloud 経由で適用
gcloud monitoring services create --service-id=web-frontend \
  --display-name="Web frontend"

gcloud alpha monitoring slos create \
  --service=web-frontend \
  --slo-from-file=availability-slo.yaml

マルチゾーンおよびマルチリージョン冗長性

# リージョン GKE クラスタ (コントロールプレーン + 3 つのゾーンにまたがるノード)
gcloud container clusters create-auto prod \
  --region=us-central1  # --zone ではなく、シングルゾーン

# リージョン Cloud SQL (別のゾーンに同期スタンバイ)
gcloud sql instances create orders \
  --availability-type=REGIONAL \
  --region=us-central1

# リージョン永続ディスク (2 つのゾーン間で同期的にレプリケート)
gcloud compute disks create app-data \
  --type=pd-balanced --size=500GB \
  --region=us-central1 --replica-zones=us-central1-a,us-central1-b
# マルチリージョン Cloud Storage (デフォルトで地理冗長)
gcloud storage buckets create gs://my-prod-data \
  --location=US --default-storage-class=STANDARD

マルチリージョン SLO を持つワークロードの場合は、--load-balancing-scheme=EXTERNAL_MANAGED を指定したグローバル HTTPS ロードバランサーの背後にある 2 つのリージョンにデプロイし、フェイルオーバーに Cloud DNS ヘルスチェックを使用します。Cloud Spanner は、同期マルチリージョン書き込みが必要な場合に適したデータベースです。

水平方向の自動スケーリング

# GKE HPA — CPU + カスタムメトリクスでスケール
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: { name: api }
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: api
  minReplicas: 3              # 3 未満にはしない (ゾーンごとに 1 つ)
  maxReplicas: 50
  metrics:
    - type: Resource
      resource: { name: cpu, target: { type: Utilization, averageUtilization: 70 } }
    - type: External
      external:
        metric:
          name: pubsub.googleapis.com|subscription|num_undelivered_messages
          selector: { matchLabels: { resource.label.subscription_id: events-sub } }
        target: { type: AverageValue, averageValue: "100" }
# Cloud Run 自動スケーリング: 最小インスタンス数は、クリティカルパスでのコールドスタートの痛みを回避します
gcloud run services update api \
  --min-instances=2 --max-instances=100 \
  --concurrency=80 --cpu-boost

ヘルスチェックとグレースフルデグラデーション

# Kubernetes liveness + readiness — readiness がトラフィックをゲートする
livenessProbe:
  httpGet: { path: /healthz, port: 8080 }
  periodSeconds: 10
  failureThreshold: 3
readinessProbe:
  httpGet: { path: /ready, port: 8080 }   # DB 接続、依存関係をチェック
  periodSeconds: 5
  failureThreshold: 2
startupProbe:
  httpGet: { path: /healthz, port: 8080 }
  failureThreshold: 30
  periodSeconds: 5
# サーキットブレーカー — ダウンストリームが遅い/失敗している場合にグレースフルに劣化
from circuitbreaker import circuit

@circuit(failure_threshold=5, recovery_timeout=30)
def fetch_recommendations(user_id):
    return recommendations_service.get(user_id, timeout=2)

def render_homepage(user_id):
    try:
        recs = fetch_recommendations(user_id)
    except Exception:
        recs = cached_default_recommendations()  # グレースフルフォールバック
    return template.render(recommendations=recs)

バックアップ、リストア、および DR テスト

# VM / GKE / データベースのバックアップおよび DR サービス
gcloud backup-dr backup-plans create web-tier-plan \
  --location=us-central1 \
  --backup-vault=projects/my-project/locations/us-central1/backupVaults/prod \
  --resource-type=compute.googleapis.com/Instance \
  --backup-rule=rule-id=daily,recurrence=DAILY,retention-days=30 \
  --backup-rule=rule-id=monthly,recurrence=MONTHLY,retention-days=365
# Cloud SQL: PITR を有効にし、四半期ごとにリストアをテストする
gcloud sql instances clone orders orders-restore-test \
  --point-in-time='2026-04-15T10:00:00Z'
# クローンを検証し、削除します — バックアップが実際にリストア可能であることを証明します

DR テストはオプションではありません。四半期ごとにスケジュールします。

  • ゲームデー: リージョンの停止をシミュレートします。トラフィックをセカンダリリージョンに強制的に送信します
  • リストアドリル: 本番環境の D
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

GCP Well-Architected Framework — Reliability

Overview

Reliability is measured by user experience, not infrastructure uptime. A system can be 100% green on the infra dashboard while users see broken checkout — that's the gap SLOs close. This skill applies the Google Cloud Well-Architected Framework's Reliability pillar to design, evaluate, and harden production workloads.

Instructions

Core Principles

Principle What it means
Define reliability via user experience Measure what users feel (request success rate, latency p99, page-load time), not just CPU/disk
Set realistic SLO targets 99.9% is roughly 43 min/month of error budget; 99.99% is 4 min — pick what your business actually needs
Build redundancy No single zone, region, or service should take down the user experience
Scale horizontally More instances, not bigger instances; this is also fault tolerance
Detect via observability Metrics + logs + traces; alert on user-facing symptoms, not on causes
Degrade gracefully Read-only mode, cached responses, queue-and-retry beat hard failures
Test failure recovery Practice failover, restore-from-backup, regional evacuation
Blameless postmortems Document the system flaw that allowed the human error

Defining SLIs and SLOs

# Example SLO definition (managed via gcloud or Terraform)
# SLI: HTTP success rate from the load balancer
# SLO: 99.9% of requests succeed over rolling 28 days
displayName: "Web frontend availability"
serviceLevelIndicator:
  requestBased:
    goodTotalRatio:
      goodServiceFilter: |
        metric.type="loadbalancing.googleapis.com/https/request_count"
        resource.labels.url_map_name="web-frontend"
        metric.labels.response_code_class="200"
      totalServiceFilter: |
        metric.type="loadbalancing.googleapis.com/https/request_count"
        resource.labels.url_map_name="web-frontend"
goal: 0.999
rollingPeriod: 2419200s  # 28 days
# Apply via gcloud
gcloud monitoring services create --service-id=web-frontend \
  --display-name="Web frontend"

gcloud alpha monitoring slos create \
  --service=web-frontend \
  --slo-from-file=availability-slo.yaml

Multi-Zone and Multi-Region Redundancy

# Regional GKE cluster (control plane + nodes across 3 zones)
gcloud container clusters create-auto prod \
  --region=us-central1  # NOT --zone, which is single-zone

# Regional Cloud SQL (synchronous standby in another zone)
gcloud sql instances create orders \
  --availability-type=REGIONAL \
  --region=us-central1

# Regional persistent disks (replicated synchronously across two zones)
gcloud compute disks create app-data \
  --type=pd-balanced --size=500GB \
  --region=us-central1 --replica-zones=us-central1-a,us-central1-b
# Multi-region Cloud Storage (geo-redundant by default)
gcloud storage buckets create gs://my-prod-data \
  --location=US --default-storage-class=STANDARD

For workloads with multi-region SLOs, deploy to two regions behind a global HTTPS load balancer with --load-balancing-scheme=EXTERNAL_MANAGED and use Cloud DNS health checks for failover. Cloud Spanner is the right database when you need synchronous multi-region writes.

Horizontal Autoscaling

# GKE HPA — scale on CPU + custom metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: { name: api }
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: api
  minReplicas: 3              # never below 3 (one per zone)
  maxReplicas: 50
  metrics:
    - type: Resource
      resource: { name: cpu, target: { type: Utilization, averageUtilization: 70 } }
    - type: External
      external:
        metric:
          name: pubsub.googleapis.com|subscription|num_undelivered_messages
          selector: { matchLabels: { resource.label.subscription_id: events-sub } }
        target: { type: AverageValue, averageValue: "100" }
# Cloud Run autoscaling: minimum instances avoids cold-start pain on critical paths
gcloud run services update api \
  --min-instances=2 --max-instances=100 \
  --concurrency=80 --cpu-boost

Health Checks and Graceful Degradation

# Kubernetes liveness + readiness — readiness gates traffic
livenessProbe:
  httpGet: { path: /healthz, port: 8080 }
  periodSeconds: 10
  failureThreshold: 3
readinessProbe:
  httpGet: { path: /ready, port: 8080 }   # checks DB connection, deps
  periodSeconds: 5
  failureThreshold: 2
startupProbe:
  httpGet: { path: /healthz, port: 8080 }
  failureThreshold: 30
  periodSeconds: 5
# Circuit breaker — degrade gracefully when downstream is slow/failing
from circuitbreaker import circuit

@circuit(failure_threshold=5, recovery_timeout=30)
def fetch_recommendations(user_id):
    return recommendations_service.get(user_id, timeout=2)

def render_homepage(user_id):
    try:
        recs = fetch_recommendations(user_id)
    except Exception:
        recs = cached_default_recommendations()  # graceful fallback
    return template.render(recommendations=recs)

Backup, Restore, and DR Testing

# Backup and DR Service for VMs / GKE / databases
gcloud backup-dr backup-plans create web-tier-plan \
  --location=us-central1 \
  --backup-vault=projects/my-project/locations/us-central1/backupVaults/prod \
  --resource-type=compute.googleapis.com/Instance \
  --backup-rule=rule-id=daily,recurrence=DAILY,retention-days=30 \
  --backup-rule=rule-id=monthly,recurrence=MONTHLY,retention-days=365
# Cloud SQL: enable PITR and test restore quarterly
gcloud sql instances clone orders orders-restore-test \
  --point-in-time='2026-04-15T10:00:00Z'
# Validate the clone, then delete it — proves backups are actually restorable

DR testing is not optional. Schedule quarterly:

  • Game days: simulate a regional outage; force traffic to the secondary region
  • Restore drills: clone a production DB to a non-prod project from backup, validate row counts and known queries
  • Failure injection: kill a random pod / zone / dependency in staging; verify SLO holds

Alerting on Symptoms, Not Causes

# Bad: alerts on CPU usage. Good: alerts on user-facing error rate.
displayName: "High error rate — web-frontend"
conditions:
  - displayName: "Error rate > 1% for 5 minutes"
    conditionThreshold:
      filter: |
        metric.type="loadbalancing.googleapis.com/https/request_count"
        resource.labels.url_map_name="web-frontend"
        metric.labels.response_code_class!="200"
      comparison: COMPARISON_GT
      thresholdValue: 0.01
      duration: 300s
notificationChannels:
  - projects/my-project/notificationChannels/oncall-pagerduty

Page on:

  • SLO burn rate (e.g., 14.4× over 1h, 6× over 6h — Google's multi-window strategy)
  • User-facing error rate
  • Latency p99 above SLO

Don't page on:

  • CPU above 80% (autoscaling handles this)
  • Disk above 80% (alert someone, but not on-call)
  • Single-instance health (the load balancer handles this)

Validation Checklist

  • [ ] User-focused SLIs/SLOs explicitly defined and dashboarded
  • [ ] No single zone — every tier is regional (GKE regional cluster, Cloud SQL HA, regional PDs, multi-region GCS)
  • [ ] Autoscaling enabled with min ≥ 3 (one per zone) and a concrete max
  • [ ] Liveness + readiness + startup probes configured for all critical pods
  • [ ] Health checks trigger automated failover at the load balancer level
  • [ ] PodDisruptionBudgets for every Deployment serving traffic
  • [ ] Backups are scheduled AND restored at least quarterly
  • [ ] Graceful degradation patterns in place (circuit breakers, retries with exponential backoff, rate limiting)
  • [ ] Game days / chaos engineering run regularly
  • [ ] Blameless postmortem template + tracking system exists and is used

    Examples

Example 1 — Production readiness review for a new service

User wants to ship a payments API. Walk through: defined SLOs (99.95% success, p99 < 500ms), regional GKE Autopilot cluster, Cloud SQL with availability-type=REGIONAL, HPA min=3 max=30, PDB minAvailable=2, readiness probe checking DB connectivity, alerting on SLO burn rate (not CPU), Backup-and-DR daily snapshots, and a quarterly restore drill on the calendar. Block ship if any of those are missing.

Example 2 — Diagnose unreliability complaints despite green dashboards

User reports "users say checkout is broken but our infra dashboards are all green." Audit: alerts are on CPU and disk usage (causes), not on HTTP 5xx rate (symptom). Wire up an SLO on payment success rate, set up multi-window burn-rate alerts (14.4× / 6× / 3× / 1×), and discover a 0.4% baseline error from a flaky third-party that was invisible until measured. Recommend retries with jitter + circuit breaker for graceful degradation.

Guidelines

  • SLOs measure user experience — pick metrics from the load balancer or app, not from the kernel
  • Default to regional everything; single-zone is dev-only
  • Min replicas ≥ 3 for any tier behind a regional load balancer
  • Alert on symptoms, not causes — a CPU alert wakes the wrong person
  • Use multi-window burn-rate alerts (Google SRE workbook approach), not simple thresholds
  • Test failure recovery quarterly — backups you've never restored aren't backups
  • PodDisruptionBudgets prevent autoscaler / upgrade rollouts from breaking SLOs
  • For graceful degradation, ship with circuit breakers, retries with exponential backoff + jitter, and read-only fallbacks
  • Blameless postmortems focus on the system flaw — humans will keep making mistakes; the system shouldn't let them cause outages
  • For multi-region SLOs, use Cloud Spanner / multi-region GCS / global HTTPS LB; resist the urge to shard yourself