Background
I came from HAproxy background and recently there is a lot of hype around "Service Mesh" Architecture. Long story short, I began to learn "Envoy" and "Consul".
I develop an understanding that Envoy is a proxy software but using sidecar to abstract in-out network with "xDS" as Data Plane for the source of truth (Cluster, Route, Filter, etc). Consul is Service Discovery, Segmentation, etc. It also abstracts network and has Data Plane but Consul can't do complex Load Balancing, filter routing as Envoy does.
As Standalone, I can understand how they work and set up them since documentation relatively good. But it can quickly became a headache if I want to integrate Envoy and Consul, since documentation for both Envoy & Consul lacks specific for integration, use-cases, and best practice.
Schematic
Consider the following simple infrastructure design:
Legends:
- CS: Consul Server
- CA: Consul Agent
- MA: Microservice A
- MB: Microservice B
- MC: Microservice C
- EF: Envoy Front Facing / Edge Proxy
Questions
Following are my questions:
- In the event of Multi-Instance Microservices, Consul (as stand-alone) will randomize round-robin. With Envoy & Consul Integration, How consul handle multi-instance microservice? which software does the load balance?
- Consul has Consul Server to store its data, however, it seems Envoy does not have "Envoy Server" to store its data, so where are its data being stored and distributed across multiple instances?
- What about Envoy Cluster (Logical Group of Envoy Front Facing Proxy and NOT Cluster of Services)? How the leader elected?
- As I mentioned above, Separately, Consul and Envoy have their sidecar/agent on each Machine. I read that when integrated, Consul injects Envoy Sidecar, but no further information on how this works?
- If Envoy uses Consul Server as "xDS", what if for example I want to add an advanced filter so that for certain URL segment it must forward to a certain instance?
- If Envoy uses Consul Server as "xDS", what if I have another machine and services (for some reason) not managed by Consul Server. How I configure Envoy to add filter, cluster, etc for that machine and services?
Thank You, I'm so excited I hope this thread can be helpful to others too.