返回 Skill 列表
extension
分类: 开发与工程无需 API Key

ArgoRollouts

Argo Rollouts 是Kubernetes的渐进式交付控制器。当用户提到滚动更新、金丝雀部署、蓝绿部署、渐进式交付、流量切换、分析模板或Argo Rollouts时使用。提供部署策略、CLI命令、指标分析和YAML示例。

person作者: jakexiaohubgithub

Argo Rollouts Skill

Comprehensive guide for Argo Rollouts - a Kubernetes controller providing advanced deployment capabilities including blue-green, canary, and experimentation for Kubernetes.

Quick Reference

| Resource | Description | |----------|-------------| | Rollout | Replaces Deployment, adds progressive delivery strategies | | AnalysisTemplate | Defines metrics queries for automated analysis | | AnalysisRun | Instantiated analysis from template | | Experiment | Runs ReplicaSets for A/B testing | | ClusterAnalysisTemplate | Cluster-scoped AnalysisTemplate |

Core Concepts

Rollout CRD

The Rollout resource replaces standard Kubernetes Deployment and provides:

  • Blue-Green Strategy: Instant traffic switching between versions
  • Canary Strategy: Gradual traffic shifting with analysis gates
  • Traffic Management: Integration with service meshes and ingress controllers
  • Automated Analysis: Metrics-based promotion/rollback decisions

Deployment Strategies

Blue-Green:

strategy:
  blueGreen:
    activeService: my-app-active
    previewService: my-app-preview
    autoPromotionEnabled: false

Canary:

strategy:
  canary:
    steps:
    - setWeight: 20
    - pause: {duration: 5m}
    - setWeight: 50
    - analysis:
        templates:
        - templateName: success-rate

Traffic Management Integrations

| Provider | Configuration Key | |----------|-------------------| | Istio | trafficRouting.istio | | NGINX Ingress | trafficRouting.nginx | | AWS ALB | trafficRouting.alb | | Linkerd | trafficRouting.linkerd | | SMI | trafficRouting.smi | | Traefik | trafficRouting.traefik | | Ambassador | trafficRouting.ambassador |

CLI Commands (kubectl-argo-rollouts)

# Installation
kubectl argo rollouts version

# Rollout Management
kubectl argo rollouts get rollout <name>
kubectl argo rollouts status <name>
kubectl argo rollouts promote <name>
kubectl argo rollouts abort <name>
kubectl argo rollouts retry <name>
kubectl argo rollouts undo <name>
kubectl argo rollouts pause <name>
kubectl argo rollouts restart <name>

# Dashboard
kubectl argo rollouts dashboard

# Validation
kubectl argo rollouts lint <file>

Analysis Providers

| Provider | Use Case | |----------|----------| | Prometheus | Metrics queries with PromQL | | Datadog | Datadog metrics API | | New Relic | NRQL queries | | Wavefront | Wavefront queries | | Kayenta | Canary analysis platform | | CloudWatch | AWS CloudWatch metrics | | Web | HTTP endpoint checks | | Job | Kubernetes Job-based analysis |

Reference Documentation

Common Patterns

Canary with Automated Analysis

steps:
- setWeight: 10
- pause: {duration: 1m}
- analysis:
    templates:
    - templateName: success-rate
    args:
    - name: service-name
      value: my-service
- setWeight: 50
- pause: {duration: 2m}

Blue-Green with Pre-Promotion Analysis

strategy:
  blueGreen:
    activeService: active-svc
    previewService: preview-svc
    prePromotionAnalysis:
      templates:
      - templateName: smoke-tests
    autoPromotionEnabled: false

Troubleshooting

| Issue | Solution | |-------|----------| | Rollout stuck in Paused | Run kubectl argo rollouts promote <name> | | Analysis failing | Check AnalysisRun status and metric queries | | Traffic not shifting | Verify traffic management provider config | | Pods not scaling | Check HPA and resource limits |

Best Practices

  1. Always use analysis gates for production canaries
  2. Set appropriate pause durations between weight increases
  3. Configure rollback thresholds in AnalysisTemplates
  4. Use preview services for blue-green validation
  5. Monitor AnalysisRuns during deployments
  6. Version your AnalysisTemplates alongside application code