Giter Site home page Giter Site logo

aws-ecs-eds's Introduction

aws-ecs-eds Docker Pulls GitHub Sponsors GitHub Workflow Status (with event)

Envoy EDS Service that automatically updates upstreams from AWS

AWS Integrations

AWS Elastic Container Service.

Gets privateIPv4Address of EC2/Fargate Tasks.

Port Resolution

  1. Environmental Variable: _aws.ecs.clusterName__port (e.g. us-west-2-fargate_port=8080)
  2. Default: 80

AWS Cloud Map

Reads SRV records from CloudMap

Port Resolution

  1. Environmental Variable: aws.cloudMap.serviceDiscoveryId_port (e.g. srv-1234_port=8080)
  2. instance['AWS_INSTANCE_PORT'] from ListInstances CloudMap API
  3. Default: 80

Envoy Config

TCP Listener Config

  1. Environmental Variable: EDS_LISTEN (e.g. 127.0.0.1:8080)
  2. Default: 0.0.0.0:5678
  3. All responses cached for 30 seconds on successful response

Config Snippet

eds-config.yaml

static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 8080 }
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: http_proxy
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match: { prefix: "/" }
route: { cluster: web }
http_filters:
- name: envoy.filters.http.router
clusters:
- name: web
connect_timeout: 10s
type: EDS
eds_cluster_config:
service_name: srv-qp3a4lugw4s5ei3a
eds_config:
resourceApiVersion: V3
api_config_source:
api_type: GRPC
transport_api_version: V3
grpc_services:
- envoy_grpc:
cluster_name: xds_cluster
- type: STATIC
connect_timeout: 10s
load_assignment:
cluster_name: xds_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 10.0.0.5
port_value: 5678
http2_protocol_options: {}
name: xds_cluster

Custom Builds

Dockerfile

aws-ecs-eds/Dockerfile

Lines 1 to 13 in 2b29f88

FROM golang:1.16.4
ENV GOOS=linux
ENV GOARCH=amd64
COPY ./ /build
WORKDIR /build
RUN go mod vendor && go build -o aws-ecs-eds main.go
FROM amazonlinux:2
ENV EDS_LISTEN="0.0.0.0:5678"
EXPOSE 5678
WORKDIR /root/
COPY --from=0 /build/aws-ecs-eds /opt
CMD ["/opt/aws-ecs-eds"]

aws-ecs-eds's People

Contributors

boostchicken avatar dependabot[bot] avatar

Watchers

 avatar  avatar

Forkers

kaminek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.