segmentio / emissary

Multi-backend Envoy xDS service.
MIT License
8 stars 7 forks source link

Introduce the Resolver interface and implement DockerResolver #14

Closed Pryz closed 5 years ago

Pryz commented 5 years ago

This PR introduces the Resolver interface and implement the DockerResolver. I've also added an example of usage in examples/docker_resolver.

There are a couple of new types introduced but the main one is Resolver which gives us an API to plug other resolvers. Right now we only do Consul and Docker but we can also introduce Kubernetes and others.

Docker Resolver

The idea of this resolver is to be able to discover local tracking-api tasks running on an EC2 instance and load balance traffic between those. The resolver uses Docker Label to find out which containers to send traffic to.

examples/docker_resolver

To run this example, you should just need to run make up.

Pryz commented 5 years ago

@rjenkins I think this PR is ready for review. This is not a high priority thing since we are still in the process of designing the best approach for Segment with Cloudflare.

Pryz commented 5 years ago

The health check system is now part of the Resolver interface.

rjenkins commented 5 years ago

+1 to merge whenever you're ready.