gRPC Traffic Controller (or gTC) is a Kubernetes controller that allows through a manifest to describe routing configuration between gRPC clients and servers. It provides configuration to the clients using the gRPC xDS service discovery integration available in all major gRPC implemetations.
Some of the gRPC features supported by gTC:
- Traffic Splitting and Routing
- Weighted Load Balancing
- Circuit breaking
- Retries
- Fault injection
- Locality Fallback
- Hash Ring Load Balancing
- Topology Aware Routing, if a destination service has TAR enabled, gTC will serve the hinted endpoints with a higher priority.
Some features I wish to add:
- Prometheus Metrics
- Integration of SPIFFE and SPIRE, for both TLS and RBAC.
Please refer to the official website.
See the example setup.
xDS features implemented in gRPC are listed here, this table tracks their support in gTC.
gRFC | Status |
---|---|
A27 | Supported (except LRS) |
A28 | Supported |
A29 | TODO |
A31 | Supported: MaxStreamDuration on routes and HTTPConnManager. |
A32 | Supported: Cluster MaxRequests |
A33 | Supported: delay and abort injection |
A36 | TODO |
A39 | Supported filters at listener, route and backend level |
A40 | TODO, Not directly related but it highlight the need of supporting CSDS on gTC's end? |
A41 | TODO |
A42 | Supported: Route Hash Policies and LB Policy on backend |
A44 | Supported, both on route and listener |
- I indend to suport xDS enabled gRPC servers, yet it might require a slight API change, or even a new CRD. More thinking is needed here.
- LRS server side is left out of scope at the moment, though it could be an interesting thing to elaborate (expose load metrics?) I am unsure of what to do with for now.
For the first time you need to install the code generation tools
make install_code_generator install_controller_tools
Then you can run
make dev
This command:
- Creates a k3d cluster
- Installs the gTC controller
- Deploy an example server
- Deploys an example client.
From there you can run a few example commands
make client_shell_0 CMD='/ko-app/client -period=100ms --addr xds:///echo-server/basic "hello there"'
make client_shell_0 CMD='/ko-app/client -premium -period=100ms --addr xds:///echo-server/abort-fault-injection-backend-override "hello there"'
Feel free to try out all the examples available
If you wish to run the test suite
make test