# 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](/grey-matter-documentation/usage/fabric/discovery/kubernetes.md)
* [Consul](/grey-matter-documentation/usage/fabric/discovery/consul.md)
* [AWS/EC2](/grey-matter-documentation/usage/fabric/discovery/ec2.md)
* [File](/grey-matter-documentation/usage/fabric/discovery/file.md)
* Envoy v1 CDS/SDS (beta)
* Envoy v2 CDS/EDS (beta)

## Registration

The Control server, in conjunction with [the Grey Matter Control API](/grey-matter-documentation/setup/fabric/configure.md), 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](/grey-matter-documentation/usage/fabric/discovery/registration.md) for details on how the Proxy needs to setup it's registration with `gm-control`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://greymatter.gitbook.io/grey-matter-documentation/usage/fabric/discovery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
