xds
最早由 Envoy 开发,用于构建 ServiceMesh 统一的 DP 接口。
- xDS API - 一套 DP API - Mesh CP <-> Proxies
- 用于 gRPC Mesh -
xds://pkg.service - gRPC 集成了 xDS
grpc.Dial("xds:///my-service")- 走控制面去发现服务
- 用于 gRPC Mesh -
- 负载均衡
- LDS - Listener Discovery Service - type.googleapis.com/envoy.config.listener.v3.Listener
- 监听器发现服务
- RDS - Route Discovery Service - type.googleapis.com/envoy.config.route.v3.RouteConfiguration
- 路由发现服务
- CDS - Cluster Discovery Service - type.googleapis.com/envoy.config.cluster.v3.Cluster
- 集群发现服务
- EDS - Endpoint Discovery Service - type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
- 端点发现服务
- ADS - Aggregate Discovery Service - gRPC
- 聚合发现服务
- 聚合所有 LDS, RDS, CDS, EDS 到一个服务
- https://github.com/envoyproxy/envoy/blob/main/api/envoy/service/discovery/v3/ads.proto
- LDS - Listener Discovery Service - type.googleapis.com/envoy.config.listener.v3.Listener
- 负载报告 - LRS
- xDSv3
- gRPC Proxyless
- Proxyless Service Mesh
- 控制面
- Istio
- Kuma
- AWS App Mesh
- Aliyun ASM
- GCP Traffic Director
- envoyproxy/go-control-plane
- 数据面
- Envoy, MOSN, AeroFS
- UDPA - Universal Data Plane API
- 服务发现,负载均衡分配,路由发现,监听器配置,安全发现,负载报告,运行状况检查委托
- 参考
- adopted by
- Apache Dubbo 3.0 集成
- 字节 Kitex Go RPC 框架
- 百度 bRPC
- envoyproxy/data-plane-api
- xDS REST and gRPC protocol
- adopted by
| Role | For |
|---|---|
| gRPC | 高性能通信 |
| Kubernetes | 服务注册、服务发现、健康检测 |
| Istio | 路由、负载,服务治理:熔断、重拾,安全:认证、mTLS,可观察性:trace、log、metrics |
gRPC xDS
- GRPC_XDS_BOOTSTRAP
- 参考
- grpc-ecosystem/grpcdebug
- 可用于 debug xds
- salrashid123/grpc_xds
- xDS Features in gRPC
- go grpc xds example
- gRPC A27: xDS-Based Global Load Balancing
- grpc-ecosystem/grpcdebug
{
// The xDS server to talk to. The value is an array to allow for a
// future change to add support for failing over to a secondary xDS server
// if the primary is down, but for now, only the first entry in the
// array will be used.
"xds_servers": [
{
"server_uri": "", //<string containing URI of xds server>,
// List of channel creds; client will stop at the first type it
// supports. This field is required and must contain at least one
// channel creds type that the client supports.
"channel_creds": [
{
"type": "", // google_default, insecure
// The "config" field is optional; it may be missing if the
// credential type does not require config parameters.
"config": "" //<JSON object containing config for the type>
}
],
"server_features": ["xds_v3"]
}
],
// JSON of proto
// https://github.com/envoyproxy/data-plane-api/blob/1adb5d54abb0e28ca409254d26fad1cf5535239b/envoy/api/v2/core/base.proto#L85-L118
"node": {
"id": "",
"cluster": "",
"metadata": {},
"locality": {
"region": "",
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
// https://cloud.google.com/compute/docs/regions-zones/
"zone": "",
"sub_zone": ""
},
"build_version": ""
}
}