Skip to content

Commit

Permalink
Update documents for ECS Service Discovery (pipe-cd#4711)
Browse files Browse the repository at this point in the history
Signed-off-by: sZma5a <[email protected]>
  • Loading branch information
t-kikuc authored and sZma5a committed Dec 17, 2023
1 parent ee656f7 commit 7e735a2
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/content/en/docs-dev/examples/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ https://github.com/pipe-cd/examples
| Name | Description |
|-----------------------------------------------------------------------------|-------------|
| [simple](https://github.com/pipe-cd/examples/tree/master/ecs/simple) | Quick sync by rolling out the new version and switching all traffic to it. |
| [simple-via-servicediscovery](https://github.com/pipe-cd/examples/tree/master/ecs/servicediscovery/simple) | Quick sync by rolling out the new version and switching all traffic to it for ECS Service Discovery. |
| [canary](https://github.com/pipe-cd/examples/tree/master/ecs/canary) | Deployment pipeline with canary strategy. |
| [canary-via-servicediscovery](https://github.com/pipe-cd/examples/tree/master/ecs/servicediscovery/canary) | Deployment pipeline with canary strategy for ECS Service Discovery. |
| [bluegreen](https://github.com/pipe-cd/examples/tree/master/ecs/bluegreen) | Deployment pipeline with blue-green strategy. |
| [secret-management](https://github.com/pipe-cd/examples/tree/master/ecs/secret-management) | Demonstrate how to manage sensitive data by using [Secret Management](../user-guide/managing-application/secret-management/) feature. |
| [wait-approval](https://github.com/pipe-cd/examples/tree/master/ecs/wait-approval) | Deployment pipeline that contains a manual approval stage. |
Expand Down
2 changes: 2 additions & 0 deletions docs/content/en/docs-dev/feature-status/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Please note that the phases (Incubating, Alpha, Beta, and Stable) are applied to
| [Automated rollback](../user-guide/managing-application/rolling-back-a-deployment/) | Beta |
| [Automated configuration drift detection](../user-guide/managing-application/configuration-drift-detection/) | Incubating |
| [Application live state](../user-guide/managing-application/application-live-state/) | Incubating |
| Quick sync deployment for [ECS Service Discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) | Alpha |
| Deployment with a defined pipeline for [ECS Service Discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) | Alpha |
| Support [AWS App Mesh](https://aws.amazon.com/app-mesh/) | Incubating |
| [Plan preview](../user-guide/plan-preview) | Alpha |
| [Manifest attachment](../user-guide/managing-application/manifest-attachment) | Alpha |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ One of `yamlField` or `regex` is required.
| taskDefinitionFile | string | The path to ECS TaskDefinition configuration file. Allow file in both `yaml` and `json` format. The default value is `taskdef.json`. See [here](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) for parameters. | No |
| targetGroups | [ECSTargetGroupInput](#ecstargetgroupinput) | The target groups configuration, will be used to routing traffic to created task sets. | Yes (if you want to perform progressive delivery) |
| runStandaloneTask | bool | Run standalone tasks during deployments. About standalone task, see [here](https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs_run_task-v2.html). The default value is `true`. |
| accessType | string | How the ECS service is accessed. One of `ELB` or `SERVICE_DISCOVERY`. See examples [here](https://github.com/pipe-cd/examples/tree/master/ecs/servicediscovery/simple). The default value is `ELB`. |

### ECSTargetGroupInput

Expand Down
17 changes: 17 additions & 0 deletions examples/ecs/servicediscovery/simple/app.pipecd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: pipecd.dev/v1beta1
kind: ECSApp
spec:
name: servicediscovery-simple
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.
description: |
This app demonstrates how to deploy an ECS application using Service Discovery with [Quick Sync](https://pipecd.dev/docs/concepts/#sync-strategy) strategy.\
No pipeline is specified then in each deployment PipeCD will roll out the new version and switch all traffic to it immediately.\
References: [adding a new app](https://pipecd.dev/docs/user-guide/managing-application/adding-an-application/), [app configuration](https://pipecd.dev/docs/user-guide/configuration-reference/)
27 changes: 27 additions & 0 deletions examples/ecs/servicediscovery/simple/servicedef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cluster: arn:aws:ecs:ap-northeast-1:XXXX:cluster/test-cluster
serviceName: nginx-discovery-simple-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/simple/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: public.ecr.aws/docker/library/httpd:2
memory: 100
mountPoints: []
name: web
portMappings:
- containerPort: 80
compatibilities:
- FARGATE
requiresCompatibilities:
- FARGATE
networkMode: awsvpc
memory: 512
cpu: 256
pidMode: ""
volumes: []

0 comments on commit 7e735a2

Please sign in to comment.