[ECS] [Service Discovery]: Support Singleton Deployments
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
**Tell us about your request**
Some applications require single-instance deployments. This seems to be in conflict with Service Discovery however.
**Which service(s) is this request for?**
ECS/Fargate
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Some applications expect to be the only one in existence by (for example) maintaining a file lock. (example: Sonatype Nexus). For this we can specify a `AWS::ECS::Service` with a `DeploymentConfiguration` that has `MaximumPercent: 100` and `MinimumHealthyPercent: 0`. This shuts down the existing container, then launches a new one.
However some peer applications may want direct access to this service so we install a `AWS::ServiceDiscovery::Service` on top. Upon testing this, I noticed ECS had launched a completely new service without having shut down the first. The log of the new one showed it discovering an existing instance and thus terminating.
So I rolled back, then commented out the ServiceDiscovery bits again and re-deployed. This worked again in the expected manner of shut-down then launch-new. So I conclude the two are mutually exclusive, at least for now.
**Are you currently working around this issue?**
We have to use a third container (traefik) to accept the traffic and route to the singleton back-end. The sibling application can then use the service DNS of traefik to target it's request.
Contributor guide
Research direction
Start by reviewing the ECS/Fargate deployment configuration using MaximumPercent: 100 and MinimumHealthyPercent: 0, then compare its behavior with the AWS::ServiceDiscovery::Service setup described here. Done means singleton deployments can use service discovery without launching overlapping instances or requiring the Traefik workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100