Auto-sync: update nexus workspace

This commit is contained in:
2026-04-29 15:44:38 +08:00
parent b2aadf771a
commit c961c6a394
114 changed files with 4784 additions and 1334 deletions

View File

@@ -1,56 +1,28 @@
---
title: "Canary Deployment"
type: concept
tags: [DevOps, Deployment, Kubernetes, ECS, AWS]
sources: [learning-sessions-ecs-deployment-using-iac-20230808-183322-meeting-recording]
last_updated: 2026-05-05
---
# Canary Deployment
## Definition
金丝雀部署Canary Deployment是一种软件发布策略通过将新版本逐步推向一小部分用户来降低风险——在新版本全面推广前先将少量流量导向新版本观察其行为和性能验证无误后再逐步扩大比例。
## Core Mechanism
1. **流量分割**:将用户流量按比例分割(如 5%/10%/50%/100%
2. **逐步提升**:从低比例开始,逐步增加新版本流量
3. **快速回滚**发现问题时,立即将流量切回旧版本
## Implementation in AWS
### ECS (Elastic Container Service)
ECS 模块支持金丝雀部署,通过 Target Group 权重调整实现流量控制:
- 创建新旧两个 Task Definition
- 通过 ALB/NLB 的 Target Group 逐步调整权重
- 结合 CloudWatch 监控自动决策扩缩比例
### EKS (Elastic Kubernetes Service)
Kubernetes 原生支持金丝雀部署,通过以下机制:
- `ReplicaSet` 控制新旧版本副本数
- `Service` 选择器配合金丝雀标签
- Argo Rollouts 等高级工具提供声明式金丝雀策略
### AWS Tools
- **AWS CodeDeploy**:原生支持 ECS 和 Lambda 的金丝雀部署策略
- **ALB Target Groups**:权重路由实现流量分割
- **CloudWatch**:金丝雀指标监控
## Comparison with Other Deployment Strategies
| 策略 | 风险 | 成本 | 适用场景 |
|------|------|------|----------|
| **Blue-Green** | 中 | 高(双倍资源) | 快速回滚需求 |
| **Canary** | 低 | 中 | 生产验证 |
| **Rolling** | 中 | 低 | 资源受限环境 |
| **A/B Testing** | 低 | 中 | 功能验证 |
## Key Metrics to Monitor
- 错误率5xx
- 延迟P50/P95/P99
- 业务指标(转化率/点击率)
- 资源利用率
## Related Concepts
- [[Blue-Green-Deployment]]:双环境切换策略
- [[ECS-Module-Deployment]]ECS 场景的模块化部署
- [[Infrastructure-as-Code]]:部署自动化基础
---
title: "Canary Deployment"
type: concept
tags:
- Deployment
- ECS
- IaC
sources:
- learning-sessions-cloud-transformation-programme-20230808-183322-meeting-recordi
last_updated: 2023-08-08
---
## Definition
Canary Deployment金丝雀部署是一种渐进式发布策略通过逐步将流量从旧版本切换到新版本降低新版本上线风险——先让少量用户"金丝雀")使用新版本,观察无异常后再全量发布。
## How It Works
1. **小流量引入**新版本部署后,仅将少量流量(如 5-10%)引导至新版本实例
2. **监控验证**:通过 CloudWatch/Grafana 等监控指标对比新旧版本表现
3. **渐进切换**:验证通过后,逐步增加新版本流量比例(如 25% → 50% → 100%
4. **自动回滚**:若新版本指标异常,自动将流量切回旧版本
## ECS Context
ECS 模块内置 Canary Deployment 支持,结合 ALBApplication Load Balancer的目标组权重规则实现零停机渐进式发布。
## Connections
- [[ECS-Module]] ← includes ← Canary Deployment
- [[Infrastructure-as-Code]]Canary 部署通过 Terraform IaC 定义
- [[Auto-Scaling]]:常与自动扩缩容配合使用