diff --git a/docs/content/en/docs-dev/examples/_index.md b/docs/content/en/docs-dev/examples/_index.md index 8d8350f8b5..23ee01ffba 100755 --- a/docs/content/en/docs-dev/examples/_index.md +++ b/docs/content/en/docs-dev/examples/_index.md @@ -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. | diff --git a/docs/content/en/docs-dev/feature-status/_index.md b/docs/content/en/docs-dev/feature-status/_index.md index 77bae8873e..6b749fb4d8 100644 --- a/docs/content/en/docs-dev/feature-status/_index.md +++ b/docs/content/en/docs-dev/feature-status/_index.md @@ -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 | diff --git a/docs/content/en/docs-dev/user-guide/configuration-reference.md b/docs/content/en/docs-dev/user-guide/configuration-reference.md index 00c5f8f473..d911109aee 100644 --- a/docs/content/en/docs-dev/user-guide/configuration-reference.md +++ b/docs/content/en/docs-dev/user-guide/configuration-reference.md @@ -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 diff --git a/examples/ecs/servicediscovery/simple/app.pipecd.yaml b/examples/ecs/servicediscovery/simple/app.pipecd.yaml new file mode 100644 index 0000000000..1a000dac6e --- /dev/null +++ b/examples/ecs/servicediscovery/simple/app.pipecd.yaml @@ -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/) diff --git a/examples/ecs/servicediscovery/simple/servicedef.yaml b/examples/ecs/servicediscovery/simple/servicedef.yaml new file mode 100644 index 0000000000..5d74444386 --- /dev/null +++ b/examples/ecs/servicediscovery/simple/servicedef.yaml @@ -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 + \ No newline at end of file diff --git a/examples/ecs/servicediscovery/simple/taskdef.yaml b/examples/ecs/servicediscovery/simple/taskdef.yaml new file mode 100644 index 0000000000..c418d4f6c4 --- /dev/null +++ b/examples/ecs/servicediscovery/simple/taskdef.yaml @@ -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: [] \ No newline at end of file