agentleFS
salmandevsalmandev/everything-gemini/skills/cloud-deploy-canary/SKILL.md

cloud-deploy-canary

Skill2 starsChanged 28 days agoApache-2.0View on GitHub

Orchestrates automated progressive delivery, canary traffic splitting, and metric-based rollback gates using Google Cloud Deploy for Cloud Run and GKE. Use when deploying critical microservices, managing canary phase progressions, or automating zero-downtime rollouts.

The file

Files
SKILL.md

Google Cloud Deploy Canary Delivery (cloud-deploy-canary)

This skill standardizes progressive delivery, multi-stage canary traffic splitting (10% $\to$ 25% $\to$ 50% $\to$ 100%), automated verification phases, and instant rollback gates utilizing Google Cloud Deploy across Google Cloud Run and Google Kubernetes Engine (GKE).


🚦 Canary Delivery Stages

graph LR
    Build[Artifact Container Image] --> Release[Cloud Deploy Release]
    Release --> Stage1[Stage 1: 10% Canary]
    Stage1 --> Verify1{Verify SLOs / Error Budget}
    Verify1 -->|Pass| Stage2[Stage 2: 50% Canary]
    Verify1 -->|Fail| Rollback[Automated Rollback to Stable]
    Stage2 --> Verify2{Verify SLOs / Latency}
    Verify2 -->|Pass| Stage3[Stage 3: 100% Full Promotion]
    Verify2 -->|Fail| Rollback

📄 Cloud Deploy Delivery Pipeline (clouddeploy.yaml)

apiVersion: deploy.cloud.google.com/v1
kind: DeliveryPipeline
metadata:
  name: core-services-pipeline
description: Production progressive canary deployment pipeline
serialPipeline:
  stages:
  - targetId: staging-cluster
    profiles: [staging]
  - targetId: prod-cluster
    profiles: [production]
    strategy:
      canary:
        runtimeConfig:
          cloudRun:
            automaticTrafficControl: true
        canaryDeployment:
          percentages: [10, 50]
          verify: true

💻 Canary Verification Job (verify.yaml)

apiVersion: batch/v1
kind: Job
metadata:
  name: verify-canary-health
spec:
  template:
    spec:
      containers:
      - name: prometheus-slo-check
        image: gcr.io/google.com/cloudsdktool/google-cloud-cli:alpine
        command:
        - /bin/sh
        - -c
        - |
          echo "Inspecting 5-minute error rates on Canary revision..."
          ERROR_RATE=$(curl -s "http://prometheus:9090/api/v1/query?query=rate(http_requests_total{status=~'5..'}[5m])")
          if [ "$ERROR_RATE" -gt 0 ]; then
            echo "SLO Violation detected! Failing verification to trigger rollback."
            exit 1
          fi
          echo "Canary verified healthy."
      restartPolicy: Never

🛠️ Operational CLI Commands

# 1. Create a canary release
gcloud deploy releases create release-$(date +%Y%m%d-%H%M) \
  --delivery-pipeline=core-services-pipeline \
  --region=us-central1 \
  --images=app=gcr.io/my-project/orders-service:latest

# 2. Advance canary from 10% to 50%
gcloud deploy rollouts advance core-services-pipeline-prod-001 \
  --release=release-20261026 \
  --delivery-pipeline=core-services-pipeline \
  --region=us-central1

# 3. Emergency automated rollback
gcloud deploy targets rollback prod-cluster \
  --delivery-pipeline=core-services-pipeline \
  --region=us-central1

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.