# Service Discovery

## Discovery

Service Discovery is the means by which the service mesh dynamically adds and removes instances of each microservice. Discovery both adds the initial instances that come online, and modifies the mesh to react to any scaling actions that happen. To keep flexibility in the Grey Matter platform, the Control server supports a number of different service discovery options and platforms.

* [Kubernetes](discovery/kubernetes)
* [Consul](discovery/consul)
* [AWS/EC2](discovery/ec2)
* [File](discovery/file)
* Envoy v1 CDS/SDS (beta)
* Envoy v2 CDS/EDS (beta)

## Registration

The Control server, in conjunction with [the Grey Matter Control API](../../setup/fabric/configure), form the control plane of the service mesh. Control API holds all the user-created mesh configuration, but it's Control that feeds the configuration directly to each connected proxy.

### Envoy Discovery Services

The Control Server acts as the Envoy Discovery Services (xDS) interface for any Envoy-based Proxy. xDS is the generic name for any of the following discovery services:

* **Endpoints (EDS)**
* **Clusters (CDS)**
* **Routes (RDS)**
* **Listeners (LDS)**
* **Access Logging (ALS)**
* **Aggregate (ADS)**

Each discovery service allows proxies (and other services that speak the xDS protocol) to request streams for particular resources (Listeners, Routes, Clusters, etc) from the control plane.

See the [proxy registration](discovery/registration) for details on how the Proxy needs to setup it's registration with `gm-control`
