Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example of ECS canary for Service Discovery #4691

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions examples/ecs/servicediscovery/canary/app.pipecd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: pipecd.dev/v1beta1
kind: ECSApp
spec:
name: servicediscovery-canary
labels:
env: example
team: xyz
input:
serviceDefinitionFile: servicedef.yaml
taskDefinitionFile: taskdef.yaml
# When you use ECS Service Discovery for interservice networking, you must specify 'SERVICE_DISCOVERY' for 'accessType'.
accessType: SERVICE_DISCOVERY
# 'targetGroups' is not used in Service Discovery type.
pipeline:
stages:
# Rollout CANARY variant's workload.
# scale represents the percentage of workload will be rolled out,
# in this case 30% of the current PRIMARY variant's workload is set.
# Note: Rolled out variant DOES serve traffic at this time unlike the ELB type.
- name: ECS_CANARY_ROLLOUT
with:
scale: 100
# Hold the deployment process for 150 seconds.
- name: WAIT
with:
duration: 150s
# Update the workload of PRIMARY variant to the new version.
# NOTE: The new PRIMARY variant will serve 100% of the traffic at this time.
- name: ECS_PRIMARY_ROLLOUT
# Destroy all workloads of CANARY variant.
- name: ECS_CANARY_CLEAN
26 changes: 26 additions & 0 deletions examples/ecs/servicediscovery/canary/servicedef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cluster: arn:aws:ecs:ap-northeast-1:XXXX:cluster/test-cluster
serviceName: nginx-canary-service
desiredCount: 2
deploymentConfiguration:
maximumPercent: 200
minimumHealthyPercent: 0
schedulingStrategy: REPLICA
# CAUTION: To enable PipeCD controls the deployment
# DeploymentController of type EXTERNAL is required.
deploymentController:
type: EXTERNAL
enableECSManagedTags: true
propagateTags: SERVICE
launchType: FARGATE
networkConfiguration:
awsvpcConfiguration:
assignPublicIp: ENABLED
securityGroups:
- sg-YYYY
subnets:
- subnet-YYYY
- subnet-YYYY
# Service Discovery Config.
serviceRegistries:
# You need to specify the service id of the service discovery namespace.
- registryArn: arn:aws:servicediscovery:ap-northeast-1:XXXX:service/srv-XXXXX
20 changes: 20 additions & 0 deletions examples/ecs/servicediscovery/canary/taskdef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
family: nginx-service-fam
executionRoleArn: arn:aws:iam::XXXX:role/ecsTaskExecutionRole
containerDefinitions:
- command: null
cpu: 100
image: XXXX.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:1
memory: 100
mountPoints: []
name: web
portMappings:
- containerPort: 80
compatibilities:
- FARGATE
requiresCompatibilities:
- FARGATE
networkMode: awsvpc
memory: 512
cpu: 256
pidMode: ""
volumes: []
Loading