deployment-strategies
Implement safe deployment strategies including rolling, blue-green, canary, and feature flags. Use this skill when planning deployments, reducing deployment risk, or implementing progressive delivery. Activate when: deployment strategy, rolling update, blue-green, canary deployment, feature flags, progressive delivery, zero downtime deployment, rollback, deployment risk.
What this skill does
# Deployment Strategies
**Deploy with confidence using progressive delivery and safe rollback.**
## Strategy Comparison
| Strategy | Risk | Complexity | Rollback Speed | Best For |
|----------|------|------------|----------------|----------|
| **Rolling** | Medium | Low | Medium | Standard updates |
| **Blue-Green** | Low | Medium | Instant | Critical services |
| **Canary** | Low | High | Fast | High-traffic services |
| **Feature Flags** | Lowest | Medium | Instant | A/B testing, gradual rollout |
## Rolling Deployment
### How It Works
```
Initial: [v1] [v1] [v1] [v1] [v1]
Step 1: [v2] [v1] [v1] [v1] [v1] # Replace 1 pod
Step 2: [v2] [v2] [v1] [v1] [v1] # Replace 2nd pod
Step 3: [v2] [v2] [v2] [v1] [v1] # Continue...
Final: [v2] [v2] [v2] [v2] [v2] # All replaced
```
### Kubernetes Configuration
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-service
spec:
replicas: 5
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # Max pods above desired during update
maxUnavailable: 0 # Never reduce below desired count
template:
spec:
containers:
- name: api
image: api-service:v2
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
```
### Best Practices
```
✓ Always set readinessProbe
✓ Use maxUnavailable: 0 for zero downtime
✓ Monitor error rates during rollout
✓ Have rollback command ready
```
## Blue-Green Deployment
### How It Works
```
Before:
┌─────────────────────────────────────────┐
│ Load Balancer │
│ │ │
│ ▼ │
│ [Blue Environment - v1] ← Active │
│ [Green Environment - idle] │
└─────────────────────────────────────────┘
Deploy to Green:
┌─────────────────────────────────────────┐
│ Load Balancer │
│ │ │
│ ▼ │
│ [Blue Environment - v1] ← Active │
│ [Green Environment - v2] Testing │
└─────────────────────────────────────────┘
Switch Traffic:
┌─────────────────────────────────────────┐
│ Load Balancer │
│ │ │
│ ▼ │
│ [Blue Environment - v1] Standby │
│ [Green Environment - v2] ← Active │
└─────────────────────────────────────────┘
```
### Kubernetes Implementation
```yaml
# Blue deployment (current production)
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-blue
labels:
version: blue
spec:
replicas: 5
template:
metadata:
labels:
app: api
version: blue
---
# Green deployment (new version)
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-green
labels:
version: green
spec:
replicas: 5
template:
metadata:
labels:
app: api
version: green
---
# Service points to active version
apiVersion: v1
kind: Service
metadata:
name: api
spec:
selector:
app: api
version: blue # Switch to 'green' to cutover
ports:
- port: 80
targetPort: 8080
```
### Switch Traffic
```bash
# Cutover to green
kubectl patch service api -p '{"spec":{"selector":{"version":"green"}}}'
# Rollback to blue
kubectl patch service api -p '{"spec":{"selector":{"version":"blue"}}}'
```
## Canary Deployment
### How It Works
```
Phase 1: 1% canary
┌──────────────────────────────────────────────────────┐
│ [Production v1] ████████████████████████████████ 99% │
│ [Canary v2] █ 1% │
└──────────────────────────────────────────────────────┘
Phase 2: 10% canary
┌──────────────────────────────────────────────────────┐
│ [Production v1] ████████████████████████████ 90% │
│ [Canary v2] ████ 10% │
└──────────────────────────────────────────────────────┘
Phase 3: 50% canary
┌──────────────────────────────────────────────────────┐
│ [Production v1] ██████████████ 50% │
│ [Canary v2] ██████████████ 50% │
└──────────────────────────────────────────────────────┘
Phase 4: Full rollout
┌──────────────────────────────────────────────────────┐
│ [Production v2] ████████████████████████████ 100% │
└──────────────────────────────────────────────────────┘
```
### Kubernetes with Istio
```yaml
# VirtualService for traffic splitting
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: api
spec:
hosts:
- api
http:
- route:
- destination:
host: api
subset: stable
weight: 90
- destination:
host: api
subset: canary
weight: 10
---
# DestinationRule defines subsets
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: api
spec:
host: api
subsets:
- name: stable
labels:
version: v1
- name: canary
labels:
version: v2
```
### Canary Analysis
```yaml
# Argo Rollouts analysis
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
metrics:
- name: success-rate
interval: 1m
successCondition: result[0] >= 0.99
provider:
prometheus:
address: http://prometheus:9090
query: |
sum(rate(http_requests_total{status!~"5.*",app="api",version="{{args.version}}"}[5m]))
/
sum(rate(http_requests_total{app="api",version="{{args.version}}"}[5m]))
```
## Feature Flags
### How It Works
```
Code deployed but inactive:
┌─────────────────────────────────────────────────────┐
│ if (featureFlags.isEnabled("new-checkout")) { │
│ return newCheckoutFlow(); // 0% of users │
│ } else { │
│ return oldCheckoutFlow(); // 100% of users │
│ } │
└─────────────────────────────────────────────────────┘
Gradually enable:
- 1% → Internal users only
- 5% → Beta users
- 25% → Random subset
- 50% → Half of traffic
- 100% → Fully enabled
```
### Implementation Example
```python
from launchdarkly import LDClient
ld_client = LDClient("sdk-key")
def checkout(user, cart):
# Check feature flag
if ld_client.variation("new-checkout-flow", user, False):
return new_checkout(user, cart)
else:
return legacy_checkout(user, cart)
```
### Rollout Strategy
```yaml
# Feature flag configuration
flag: new-checkout-flow
environments:
production:
rollout:
- date: "2026-01-15"
percentage: 1
targets: ["internal"]
- date: "2026-01-17"
percentage: 10
targets: ["beta-users"]
- date: "2026-01-20"
percentage: 50
- date: "2026-01-25"
percentage: 100
kill_switch: true # Can instantly disable
```
## Choosing a Strategy
```
┌─────────────────────────────────────────────────────┐
│ What type of change? │
├────────────────────────────┬────────────────────────┤
│ Infrastructure/config │ Database migration │
│ │ │ │ │
│ ▼ │ ▼ │
│ Rolling Update │ Blue-Green + │
│ │ Feature Flag │
├────────────────────────────┼────────────────────────┤
│ User-facing feature │ High-risk change │
│ │ │ │ │
│ ▼ │ ▼ │
│ Feature Flag + │ Canary with │
│ Canary │ Auto-rollback │
└────────────────────────────┴────────────────────────┘
```
## Deployment CheckRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.