Search code examples
routesrdsservice-discoverylyft-apienvoyproxy

what is the use of service_cluster and service_node in Envoy RDS REST API?


I am trying to develop RDS (Route Discovery Service) to be used with lyft/envoy. As per docs RDS API URL should follow GET /v1/routes/(string: route_config_name)/(string: service_cluster)/(string: service_node). What I want to know is the usage of service_cluster and service_node.

Currently I havent used those for any specific task, just the GET path is matched and a single route is defined. Which is working just fine. I checked what value envoy sends for those and got service_cluster: lax & service_node: node1, not much of help. Docs says these value can also be set via CLI options.

What is it supposed to be used for? Am I missing something?


Solution

  • My understanding is this: Envoy is designed to be a proxy for a microservice, in a mesh of microservices. So you can have multiple envoys getting routes configuration from RDS. When you design your mesh you can decide how you group these multiple envoys - it is a contract between your mesh and your RDS. RDS has two levels of grouping - by service cluster and service node. So you can decide, for example, to call multiple versions of the same microservice service nodes of a service cluster (the microservice with multiple versions).

    So you can assign each envoy instance in the mesh a service cluster and a service node identifier and pass to envoy these parameters in the command line. Then envoy will pass them to RDS to get the routes. The RDS then can return different routes to different service clusters and service nodes, if needed by your mesh design.

    If you do not use envoy as part of a mesh, i.e. you run just a single envoy, you can just disregard these parameters in your RDS implementation.