Add support for ECS Anywhere

This commit is contained in:
José Gaspar 2022-09-14 15:22:08 +01:00 committed by GitHub
parent fd95560c66
commit b351266b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 138 additions and 11 deletions

View file

@ -47,7 +47,8 @@ Traefik needs the following policy to read ECS information:
"ecs:DescribeTasks",
"ecs:DescribeContainerInstances",
"ecs:DescribeTaskDefinition",
"ec2:DescribeInstances"
"ec2:DescribeInstances",
"ssm:DescribeInstanceInformation"
],
"Resource": [
"*"
@ -57,6 +58,10 @@ Traefik needs the following policy to read ECS information:
}
```
!!! info "ECS Anywhere"
Please note that the `ssm:DescribeInstanceInformation` action is required for ECS anywhere instances discovery.
## Provider Configuration
### `autoDiscoverClusters`
@ -86,6 +91,33 @@ providers:
# ...
```
### `ecsAnywhere`
_Optional, Default=false_
Enable ECS Anywhere support.
- If set to `true` service discovery is enabled for ECS Anywhere instances.
- If set to `false` service discovery is disabled for ECS Anywhere instances.
```yaml tab="File (YAML)"
providers:
ecs:
ecsAnywhere: true
# ...
```
```toml tab="File (TOML)"
[providers.ecs]
ecsAnywhere = true
# ...
```
```bash tab="CLI"
--providers.ecs.ecsAnywhere=true
# ...
```
### `clusters`
_Optional, Default=["default"]_

View file

@ -573,6 +573,9 @@ Constraints is an expression that Traefik matches against the container's labels
`--providers.ecs.defaultrule`:
Default rule. (Default: ```Host(`{{ normalize .Name }}`)```)
`--providers.ecs.ecsanywhere`:
Enable ECS Anywhere support (Default: ```false```)
`--providers.ecs.exposedbydefault`:
Expose services by default (Default: ```true```)

View file

@ -573,6 +573,9 @@ Constraints is an expression that Traefik matches against the container's labels
`TRAEFIK_PROVIDERS_ECS_DEFAULTRULE`:
Default rule. (Default: ```Host(`{{ normalize .Name }}`)```)
`TRAEFIK_PROVIDERS_ECS_ECSANYWHERE`:
Enable ECS Anywhere support (Default: ```false```)
`TRAEFIK_PROVIDERS_ECS_EXPOSEDBYDEFAULT`:
Expose services by default (Default: ```true```)

View file

@ -204,6 +204,7 @@
region = "foobar"
accessKeyID = "foobar"
secretAccessKey = "foobar"
ecsAnywhere = true
[providers.consul]
rootKey = "foobar"
endpoints = ["foobar", "foobar"]

View file

@ -220,6 +220,7 @@ providers:
region: foobar
accessKeyID: foobar
secretAccessKey: foobar
ecsAnywhere: true
consul:
rootKey: foobar
endpoints: