ECS Service Discovery
Project description
Yet another tool to perform ECS API based service discovery. Primarily aimed at gapping the lack of integrations for ECS Anywhere.
Features
Creates Prometheus scraping configuration, from scanning ECS clusters & services, based on docker labels
Installation
Docker
Head to Public ECR to obtain the image
docker run --rm -it -v ~/.aws:/root/.aws public.ecr.aws/compose-x/ecs-service-discovery
Python
For your user only
pip install pip --user ecs-service-discovery
Via virtual environment
pip install ecs-service-discovery
Usage
usage: ecs-sd [-h] [-d OUTPUT_DIR] [--profile PROFILE] [-p PROMETHEUS_PORT] [--intervals INTERVALS] [--prometheus-output-format PROMETHEUS_OUTPUT_FORMAT] [_ ...]
positional arguments:
_
options:
-h, --help show this help message and exit
-d OUTPUT_DIR, --output_dir OUTPUT_DIR
--profile PROFILE aws profile to use. Defaults to SDK default behaviour
-p PROMETHEUS_PORT, --prometheus-port PROMETHEUS_PORT
--intervals INTERVALS
Time between ECS discovery intervals
--prometheus-output-format PROMETHEUS_OUTPUT_FORMAT
Change the format of generated files. JSON or YAML.
Examples
ECS Compose-X
Install ecs-compose-x & deploy to AWS
Docker Compose
After cloning the repository, run docker compose up. It will spin the service discovery, along with prometheus & grafana to run the demo with. You can access prometheus via localhost:9090 and grafana via localhost:3000 (admin:admin by default).
In prometheus, you can look at the configuration and service discovery. You should see the discovered targets that prometheus is going to try to scrape.
AWS Policy requirements
PolicyName: ECSServiceDiscoverySimple
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- ecs:ListClusters
- ecs:ListContainerInstances
- ecs:ListTasks
- ecs:DescribeContainerInstances
- ssm:DescribeInstanceInformation
- ecs:DescribeTasks
- ecs:DescribeTaskDefinition
Resource: '*'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ecs_service_discovery-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3f12990c6927d9ff5d8b06b15782edef86a02e530e99289fd7df094556d957 |
|
MD5 | 7c725c7803c95199a3fdf5edfa3b9fac |
|
BLAKE2b-256 | 68295796ddd5480e338838e848e1b98dbd049a99c21b010f364a25cc819126c8 |
Hashes for ecs_service_discovery-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5bf4d9b49bcbcb305418c0f60e49f568495da1c83e33fcf60c7d337e5c5f95c |
|
MD5 | 3859da81dcab3c738855c136befed1d9 |
|
BLAKE2b-256 | 83026e2882779baeffe5b66317ff2997686ce88884fac3091ca9f7d65b54f772 |