sofastack / sofa-registry

SOFARegistry is a production-level, low-latency, high-availability service registry powered by Ant Financial.
https://www.sofastack.tech/sofa-registry/docs/Home
Apache License 2.0
652 stars 247 forks source link

SOFARegistry compitable for Istio #173

Open NickNYU opened 3 years ago

Xunzhuo commented 3 years ago

@assign

Xunzhuo commented 3 years ago

Hi @NickNYU There are two Proposals to make SOFARegistry compitable for Istio, I want to have a discussion with the communiy.

Architecture

arich

Proposal one: MCP-over-XDS (Blue flow in Architecture)

ps: I will call MCP-over-XDS by MoX for simplifying

As the MCP protocal has been deprecated after istio 1.9, we choose MoX server to watch SOFA-Registy. At the same time, istio pilot subscribe MoX server with gRPC stream after config MoX server address in pilot configSource. When MoX server get services info from SOFA-registy, MoX server will do these two things:

  1. Transform services info into ServiceEntry/WorkloadEntry which pilot can read from.
  2. Sotw Push ServiceEntry/WorkloadEntry to pilot.

After pilot getting ServiceEntry/WorkloadEntry from MoX server by External Service Discovery, and then tranform them into Service Registy and pass them to Serivce Controller. Then Discovery Service will watch the changes from Service Controller and push to Envoy data plane by xDS in gRPC streams.

pro1

Proposal two: Write ServiceEntry and WorkloadEntry to API Server. (Green flow in Architecture)

In this way, we just need to create an adaptor to read services info from SOFARegisty and tranform them into ServiceEntry and WorkloadEntry.Then the adaptor just write ServiceEntry and WorkloadEntry into Kubernetes by ApiServer.

The kube Config Controller in pilot will watch these changes and transform ServiceEntry and WorkloadEntry into Service Registy and pass them to Serivce Controller. When Discovery Service watch Changes from Service Controller, it will push changes to Envoy data plane by xDS in gRPC streams.

未命名绘图