Closed benja-wu closed 3 years ago
I have a suggestion:
in the data plane, EG-sidecar, when it receives a registry request, it doesn't register to the Etcd immediately. The sidecar just returns a successful result to the real service no matter what's the result of the etcd registration. The sidecar registration will be designed as the level trigger design, it's an asynchronous registration.
ps: s/pooling/polling/g
Got it. EG-sidecar's asynchronous registration will be more resilient when the network inside a Pod becomes unstable or something else happens.
ps: replacing done.
After discussion with @xxx7xxxx and @zhao-kun , the original ETCD storage layout
meshServicesPrefix = "/mesh/services/%" // +serviceName (its value is the basic mesh spec)
meshServicesResiliencePrefix = "/mesh/services/%s/resilience" // +serviceName(its value is the mesh resilience spec)
meshServicesCanaryPrefix = "/mesh/services/%s/canary" // + serviceName(its value is the mesh canary spec)
meshServicesLoadBalancerPrefix = "/mesh/services/%s/loadBalancer" //+ serviceName(its value is the mesh loadBalance spec)
meshSerivcesSidecarPrefix = "/mesh/serivces/%s/sidecar" // +serviceName (its value is the sidecar spec)
meshServicesObservabilityPrefix = "/mesh/services/%s/observability" // + serviceName(its value is the observability spec)
will be merged into one spec in ETCD
meshServicesPrefix = "/mesh/services/%"
Finished and merged into EG mesh branch already.
Background
According to the MegaEase ServiceMesh requirements[1], one major duty for Control Plane(EG-master) is to handle service registry requests. Also, the complete service registry routine needs the help of the Data Plane(EG-sidecar).
Proposal
Registry metadata
The JSON struct above is one service instance registry info for the order service in takeaway tenant. It has a UUID. By default, its leases will be available for ten years. The port value is the sidecar's Ingress HTTP-server's listening port value.
ETCD data layout
So the tree layout in etcd store looks like:
Control Plane
$./etcdctl get "/mesh/tenants" --prefix tenant-001 {"desc":"this is a demo tenant","createdTime": 1614066694} $ ./etcdctl get "/mesh/tenants/tenant-001" ["order","address"]