This small server can be used for:
- gRPC client-side Load Balancing
- Envoy cluster CDS
Configuration in the client (supported clients as of september 2020: C-core, Java & Go) goes like this:
-
- Set the environment variable
GRPC_XDS_BOOTSTRAP=/bootstrap.json
(doc)
- Set the environment variable
-
- Add this file
/bootstrap.json
containing these contents:
{ "xds_servers": [{ "server_uri": "xds-server-address:8080" }], "node": { "id": "$HOSTNAME", "metadata": { "SOME_KEY": "SOME_VALUE" }, "locality": { "zone": "europe-west4-a" } } }
- Add this file
-
- Create the gRPC client like this:
import ( _ "google.golang.org/grpc/xds" // To install the xds resolvers and balancers. ) grpc.Dial("xds:///upstream-service", grpc.WithInsecure())
- Guide to the xDS protocol
- Original proposal: https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md
- https://itnext.io/proxyless-grpc-load-balancing-in-kubernetes-ca1a4797b742 & https://github.com/asishrs/proxyless-grpc-lb
- GoogleBlog: efficient multi-zone and topology aware routing
- This is an (more flexible) alternative to the TopologyAwareHints beta-feature in Kubernetes 1.23+
- Using xDS v3: server_features <- xds_v3
- gRPC xDS Loadbalancing
- debug gRPC xDS clients