Commit 82cfa3b
committed
feat: service discovery by default
This change enables service discovery by default for
all apps. Service discovery alows apps within an
environment to communicate with each other without
having to traverse the internet (traffic is routed
internally within the VPC).
To access a service via its service discovery endpoint,
you can make a request like:
```golang
resp, _ := http.Get(fmt.Sprintf("http://%s.%s", appName, os.Getenv("ECS_APP_DISCOVERY_ENDPOINT"))
```
Or, with only the project name:
```golang
resp, _ := http.Get(fmt.Sprintf("http://%s.%s.local", appName, projectName))
```
Or, without the string interpolation:
```golang
# Making a request to app `api` in project `kudos`
resp, _ := http.Get("http://api.kudos.local")
```
The same address works across environments, since the requests
are scoped to services within one environment.
__ Why not just .local ?__
A couple of reasons to go for the `.{project}.local` scheme, rather
than just `.local` or just `.{project}`.
The reason for not using just `.local` is just to reduce the chance
of a namespace colision if another project is using the same VPC.
The reason for not just going with `.{project}` is in case the
project name matches an existing TLD. That'd be confusing behavior.
The `.local` TLD doesn't seem to exist.
__ Why make this default for every service? __
You can't add service discovery after the fact, unfortunately.
The only sensible thing is to just enable it by default. In the
future, we can offer a disable knob, but it's very cheap (less
than a dollar per month per env) - so isn't a huge burden for
customers who end up not using it.
resolves #5991 parent b94b910 commit 82cfa3b
File tree
18 files changed
+265
-48
lines changed- e2e/multi-app-project
- back-end
- front-end
- internal/pkg/deploy/cloudformation
- templates
- environment
- lb-fargate-service
18 files changed
+265
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
2 | 20 | | |
3 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
4 | 33 | | |
5 | | - | |
6 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
2 | 20 | | |
3 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
4 | 33 | | |
5 | | - | |
6 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
This file was deleted.
0 commit comments