Example Rate-limit Configuration SotW xDS Server

February 7, 2023 ยท View on GitHub

This is an example of a trivial xDS V3 control plane server similar to the example server in go-control-plane. It serves sample Rate limit configuration. You can run the example using the project top-level docker-compose-example.yml, e.g.:

export CONFIG_TYPE=GRPC_XDS_SOTW
docker-compose -f docker-compose-example.yml --profile xds-config up --build --remove-orphans

The docker-compose builds and runs the example server along with Rate limit server. The example server serves a configuration defined in resource.go. If everything works correctly, you can follow the examples in project top-level README.md file.

Files

  • main/main.go is the example program entrypoint. It instantiates the cache and xDS server and runs the xDS server process.
  • resource.go generates a Snapshot structure which describes the configuration that the xDS server serves to Envoy.
  • server.go runs the xDS control plane server.
  • logger.go is the logger.