/devops-skills:blue-green-canary-deploymentsfrom devops-skills
Designs and executes progressive delivery strategies including blue-green cutover, canary rollout, and traffic-shifted releases with automated health checks and rollback triggers, typically on Kubernetes.
Ships in devops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Deploying a new version by simply replacing the old one ("recreate" or a rolling update with no verification) means any regression is discovered by users, at 100% of traffic, with rollback happening only after someone notices. Blue-green and canary strategies exist to decouple deploying new code from exposing it to all traffic, so that a bad release affects a small, quickly-reversible blast radius (or none at all, in blue-green's case) instead of the whole user base. This matters operationally because it turns "did the deploy work?" from a question answered by incident reports into one answered by automated health signals before full rollout.
Deployment
rolling updates alone do not give you traffic-percentage control, only
pod-replacement pacing.AnalysisTemplate and Flagger) exposing error rate, latency, and
saturation for the service.Choose the strategy based on risk and cost tolerance. Blue-green gives instant, full-traffic rollback (flip the router back) at the cost of running double capacity briefly. Canary gives fine-grained, metric-driven risk containment (bad version only ever sees a fraction of traffic) at the cost of more complex automation and a longer rollout window. Many teams combine them: canary for routine releases, blue-green for high-risk or infrequent major changes.
Blue-green with a Kubernetes Service selector flip (simple approach, no mesh required):
# New version deployed as "green", labeled distinctly from "blue"
apiVersion: apps/v1
kind: Deployment
metadata:
name: payments-api-green
spec:
replicas: 5
selector:
matchLabels: { app: payments-api, slot: green }
template:
metadata:
labels: { app: payments-api, slot: green }
spec:
containers:
- name: payments-api
image: ghcr.io/example/payments-api:1.4.2
---
# Cutover: flip the Service selector from slot: blue to slot: green
apiVersion: v1
kind: Service
metadata:
name: payments-api
spec:
selector: { app: payments-api, slot: green } # was: slot: blue
ports: [{ port: 80, targetPort: 3000 }]
Verify green health (readiness probes green, smoke tests passing)
before applying the selector flip. Keep blue running, unscaled,
for a rollback window; flipping the selector back is the rollback.
Canary with Argo Rollouts (traffic-percentage steps with automated analysis):
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: payments-api
spec:
replicas: 10
strategy:
canary:
steps:
- setWeight: 10
- pause: { duration: 5m }
- analysis:
templates:
- templateName: success-rate-check
- setWeight: 50
- pause: { duration: 10m }
- setWeight: 100
template:
metadata:
labels: { app: payments-api }
spec:
containers:
- name: payments-api
image: ghcr.io/example/payments-api:1.4.2
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate-check
spec:
metrics:
- name: error-rate
interval: 1m
successCondition: result[0] <= 0.01
provider:
prometheus:
address: http://prometheus.monitoring:9090
query: |
sum(rate(http_requests_total{app="payments-api",status=~"5.."}[5m]))
/
sum(rate(http_requests_total{app="payments-api"}[5m]))
The rollout automatically pauses at each step, runs the analysis
query, and aborts and rolls back automatically if error-rate
exceeds the threshold — no human needs to be watching for the common
failure mode.
Flagger equivalent (canary via a Canary CR wrapping an existing
Deployment, commonly paired with Istio or a supported ingress):
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: payments-api
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: payments-api
progressDeadlineSeconds: 600
analysis:
interval: 1m
threshold: 5
stepWeight: 10
maxWeight: 50
metrics:
- name: request-success-rate
thresholdRange: { min: 99 }
interval: 1m
service:
port: 80
Verify before promoting, promote deliberately. Whether via
pause: steps that require an operator to confirm (kubectl argo rollouts promote payments-api) or fully automated analysis, never
promote to 100% purely on a fixed timer with no health signal attached
— the whole point of canary is that the signal, not the clock,
decides.
Roll back explicitly when analysis fails or a human calls it.
kubectl argo rollouts abort payments-api # halt and revert to stable
kubectl argo rollouts undo payments-api # revert to previous revision
For blue-green's Service-selector approach, rollback is simply
flipping the selector back to blue — keep blue running unscaled
(not deleted) until green has fully soaked, specifically so this is
available.
latest tag
that moved mid-rollout invalidates the whole analysis.Symptom: Canary rollout appears stuck at an intermediate weight
(e.g., 20%) indefinitely.
Fix: Check whether a manual pause step is waiting on an explicit
promote command that nobody issued, versus an automated analysis step
that's failing its query (misconfigured Prometheus address/label
selector) and therefore never satisfying its success condition — the
fix differs (promote manually vs. fix the analysis query).
Symptom: Canary/blue-green rollout passes all health checks but a downstream service or the database breaks once the old version is fully retired. Fix: This usually means a backward-incompatible schema or contract change shipped as part of the release — audit for migrations that aren't safe for both versions to run against simultaneously, and adopt an expand/contract pattern for future schema changes.
Symptom: Automated rollback triggers on every release, even ones that turn out to be fine, causing the team to stop trusting (and eventually disable) the analysis gate. Fix: The analysis threshold is likely too tight relative to normal metric noise — baseline the metric's normal variance first (e.g., what does error rate look like across a stable deploy) and set thresholds with margin above that noise floor, rather than an arbitrary round number.
Symptom: Blue-green cutover causes a brief spike of dropped
connections at the exact moment of the flip.
Fix: Ensure the router/Service waits for the new environment's
readiness probes to pass and drains in-flight connections from the
old environment gracefully (connection draining / preStop hook with a
delay) rather than flipping and terminating old pods simultaneously.
Symptom: Canary at 100% weight for a long time before someone notices it never finished promoting, leaving mixed versions running far longer than intended. Fix: Alert on rollout state (Argo Rollouts/Flagger both expose status conditions) explicitly, rather than treating "no alert fired" as equivalent to "rollout completed."
Scenario: Release payments-api:1.4.2 as a canary, targeting a
30-minute automated rollout with an error-rate gate, on a cluster already
running Argo Rollouts.
Rollout resource's image to 1.4.2 (via the GitOps
config repo, per
gitops-workflow) and let the operator
reconcile it.setWeight: 10 and
begins routing 10% of traffic to 1.4.2.success-rate-check AnalysisTemplate
queries Prometheus; if 5xx rate over the last 5 minutes for the canary
pods is ≤ 1%, analysis passes and the rollout proceeds to
setWeight: 50.1.4.1 ReplicaSet, and the rollout
status is marked Degraded — no manual intervention was required to
contain the blast radius to the ~10% of traffic that saw the canary
for those 5 minutes.setWeight: 100, the previous stable ReplicaSet (1.4.1)
is scaled down but not deleted immediately, preserving a fast-rollback
option (kubectl argo rollouts undo payments-api) during the
post-release soak window.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/artifact-and-dependency-managementManages build artifacts and third-party dependencies through a private registry/proxy with lockfiles, version pinning, retention policies, and automated update workflows. Use when the user asks to "set up an artifact repository," "configure a package registry proxy/mirror," "pin/lock dependency versions," "clean up old artifacts," "handle a dependency update / Dependabot-Renovate PR," or "avoid a left-pad-style supply-chain incident."
/ci-access-and-credential-lifecycle-managementManages the lifecycle of one-off/temporary repo and environment access grants and CI service-account credentials — granting time-boxed access for a specific task, revoking it reliably when the task ends, and rotating CI service-account tokens/keys before they expire or become stale. Use when the user asks to "give a contractor temporary repo access," "grant one-off access to the production environment," "rotate our CI service account token/API key," "find and revoke stale CI credentials," or "our CI token is about to expire, what do we do."
/ci-cd-pipeline-designDesigns and troubleshoots CI/CD pipelines (GitHub Actions, GitLab CI, or equivalent) including stage layout, caching, parallelization, quality gates, and secrets handling. Use when the user asks to "set up a CI/CD pipeline," "add a build/test/deploy workflow," "fix a failing pipeline stage," "speed up CI," "add branch protection / required checks," or "design a deployment pipeline" for an application or infrastructure repo.
/container-build-and-releaseBuilds, tags, scans, and publishes container images with reproducible, minimal, multi-stage Dockerfiles and a defensible tagging/release scheme. Use when the user asks to "write a Dockerfile," "reduce image size," "set up multi-arch builds," "tag and push a container image," "add image scanning to the pipeline," or "publish a release image to a registry."
/devops-delivery-metrics-and-dora-analysisMeasures and interprets the DORA four keys — deployment frequency, lead time for changes, mean time to restore (MTTR), and change failure rate — including how to compute each one correctly, common measurement pitfalls (vanity metrics, gaming the numbers, misclassifying a rollback), and how to use the results to drive process improvement rather than individual blame. Use when the user asks to "set up DORA metrics," "measure our deployment frequency/lead time," "what's our change failure rate," "are we an elite/high/medium/low performer," or "use delivery metrics to improve, not to blame the team."
/emergency-hotfix-deployment-procedureDefines the out-of-cadence process for shipping a production hotfix outside the normal release train — which checks are genuinely safe to bypass versus never, the minimum required verification before an emergency deploy, required sign-off, and the rollback plan that must exist before the hotfix goes out. Use when the user asks to "ship an emergency hotfix," "deploy outside the normal release process," "bypass the release train for a critical fix," "what's the minimum we can skip for a production emergency," or "we need to patch prod right now."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin devops-skillsOther plugins' skills for the same job