Giter Site home page Giter Site logo

raducrisan1 / envoy-eds-server Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 22.63 MB

A working example of Envoy EDS Server written in go.

License: Apache License 2.0

Dockerfile 4.21% Shell 3.76% Go 92.02%
envoy eds golang go-control-plane xds-server xds rest grpc

envoy-eds-server's Introduction

envoy-eds-server

Description

Envoy EDS server is a working Endpoint Discovery Service implementation. It stores in memory an upstream host list and allows any upstream host to register and reregister.

Internally, envoy-eds-server starts two servers:

  • a gRPC server that is invoked by Envoy to fetch the list of upstream hosts. It uses the go-control-plane library provided by the Envoy authors.
  • a HTTP REST API server where a new host self-registers and deregisters when graceful shutdown happens.

Envoy makes use of gRPC client stream and is able to receive notifications once an upstream host is registered or unregistered; it does not need poll to update.

As a good practice, the upstream host should invoke the registration on the REST API server periodically, like a heartbeat. This periodic registration update allows the EDS server to become stateless, avoiding in this way the need of a dynamic configuration persistence. The in-memory store of the upstream host list is a good approach because this simplifies the eds server setup (no need to persist the settings) and ensures the configuration becomes consistent even if the EDS server is restarted.

Docker usage

The following environment variables must be defined:

  • HTTP_LISTEN_PORT choose the listen port for the HTTP server - the one where upstream hosts are registered / unregistered
  • GRPC_LISTEN_PORT choose the listen port for the gRPC server - the one consumed by Envoy.
  • EVICTION_TIMEOUT_IN_SEC choose the time interval to elapse in order to remove the EDS resource because of not receiving a heartbeat API call from the upstream host. Defaults to 42 seconds. If set to zero then the Endpoints (EDS resources) are no more removed and are kept until the envoy-eds-server is restarted.

To start a docker container from the pre-built image, run:

docker run --name envoy-eds-server --rm -p 8089:8089 -p 8086:8086 raducrisan/envoy-eds-server

or

docker run --name envoy-eds-server --rm --env EVICTION_TIMEOUT_IN_SEC=10 -p 8089:8089 -p 8086:8086 raducrisan/envoy-eds-server

envoy-eds-server's People

Contributors

raducrisan1 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.