Hi all,
I am working on the above mentioned project.
The Goal of this project is to integrate Consul service registry's service
discovery feature with WSO2 Envoy based microgateway.

*Configuring Microgateway with Consul*
Configure consul globally with microgateway. Add the settings to the main
config file for the microgateway.
*Defining endpoints on API Manager/ Swagger*
Endpoints should be defined according to the following syntax:
Consul:service-name  OR
consul:[data-centers].service-name.[tags] OR
consul:[data-centers].namespace.service-name.[tags]  (to support the
namespace enterprise feature)
Data Centers are separated by commas
Tags also should be separated by commas

Examples:
Use service instances of the inventory service which has a production tag,
in datacenter aws-us-east-1,
consul:[aws-us-east-1].inventory.[production]
Use service instances of the payment service which has either of production
tag or new tag, in gcp-asia-east1 or aws-ca-central-1 datacenters,
consul:[gcp-asia-east1,aws-ca-central-1].payment.[production,new]

*How microgateway connects to service instances *
*Scenario 1: Consul deployed without a service mesh:*
https://lucid.app/publicSegments/view/49f3c04c-8686-4c0b-b292-4bb0d896b8d7/image.png
*Scenario 2: Consul deployed as a service mesh:*
https://lucid.app/publicSegments/view/28869587-4853-483b-8190-4e84c0c5e4dd/image.png

In a service mesh(scenario 2):
Service to service communication happens using mTLS.
Sidecar proxies enforce intentions.
Microgateway has to be registered as a service with Consul.
Communication across k8s clusters(if we have multiple) happens through mesh
gateways.

*Implementation*
Implementation logic will be on the control plane.
Using the official Go client for the Consul HTTP API,

   1. Poll the service registry for updates
   2. Identify whether changes have occurred on endpoints
   3. Call EDS API to update Envoy Proxies if there are any changes.

https://lucid.app/publicSegments/view/d58289de-99e2-4d27-8dac-69904ffc91e4/image.png
*The DNS Interface*
Consul server runs DNS that can be used to discover services.
Currently, Envoy supports only resolving ‘A records’ and does not support
resolving SRV records.
Thus, service discovery for the micro gateway will be implemented using the
HTTP interface only.
Later, if Envoy supports SRV records resolution, the proposed syntax of
defining services can still be used. The syntax can be parsed and converted
into DNS queries and passed to Envoy. Envoy will poll the DNS server for
changes and update endpoints accordingly.

Regards,
*Rumesh Sirithunga* | Intern | WSO2 Inc.
(m) +94767261089 | (e) [email protected]
<http://wso2.com/signature>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to