|
| 1 | +apiVersion: pipecd.dev/v1beta1 |
| 2 | +kind: ECSApp |
| 3 | +spec: |
| 4 | + input: |
| 5 | + serviceDefinitionFile: servicedef.yaml |
| 6 | + taskDefinitionFile: taskdef.yaml |
| 7 | + targetGroups: |
| 8 | + # Primary target group is pointed by LB (ALB/NLB) live listener, the Primary task set |
| 9 | + # will be registered to this target group. |
| 10 | + primary: |
| 11 | + targetGroupArn: arn:aws:elasticloadbalancing:ap-northeast-1:XXXX:targetgroup/ecs-tg-blue/YYYY |
| 12 | + containerName: web |
| 13 | + containerPort: 80 |
| 14 | + # Canary target group can also be pointed by LB (ALB/NLB) live listener at |
| 15 | + # the beginning of deployment, the Canary task set will be registered to this target group. |
| 16 | + # CAUTION: To enable PipeCD performs bluegreen deployment strategy, this canary target group |
| 17 | + # is required. |
| 18 | + canary: |
| 19 | + targetGroupArn: arn:aws:elasticloadbalancing:ap-northeast-1:XXXX:targetgroup/ecs-tg-green/ZZZZ |
| 20 | + containerName: web |
| 21 | + containerPort: 80 |
| 22 | + pipeline: |
| 23 | + stages: |
| 24 | + # Rollout CANARY variant's workload. |
| 25 | + # scale represents the percentage of workload will be rolled out, |
| 26 | + # in this case 100% of the current PRIMARY variant's workload is set. |
| 27 | + # Note: Rolled out variant serves no traffic at this time. |
| 28 | + - name: ECS_CANARY_ROLLOUT |
| 29 | + with: |
| 30 | + scale: 100 |
| 31 | + # Change the traffic routing state where |
| 32 | + # the CANARY workloads will receive the specified percentage of traffic. |
| 33 | + # In blue-green deployment strategy, 100% of traffic will be routed to |
| 34 | + # CANARY workloads. |
| 35 | + - name: ECS_TRAFFIC_ROUTING |
| 36 | + with: |
| 37 | + canary: 100 |
| 38 | + # Hold the deployment process for 150 seconds. |
| 39 | + - name: WAIT |
| 40 | + with: |
| 41 | + duration: 150s |
| 42 | + # Update the workload of PRIMARY variant to the new version. |
| 43 | + - name: ECS_PRIMARY_ROLLOUT |
| 44 | + # Change the traffic routing state where |
| 45 | + # the PRIMARY workloads will receive 100% of the traffic. |
| 46 | + - name: ECS_TRAFFIC_ROUTING |
| 47 | + with: |
| 48 | + primary: 100 |
| 49 | + # Destroy all workloads of CANARY variant. |
| 50 | + - name: ECS_CANARY_CLEAN |
0 commit comments