2020-01-11 08:48:30 +01:00
|
|
|
Hacking on *traffic*
|
|
|
|
|
|
|
|
|
|
Repos used:
|
|
|
|
|
|
|
|
|
|
<https://github.com/envoyproxy/go-control-plane>
|
|
|
|
|
: implements control plane, has testing stuff in pkg/test/main (iirc).
|
|
|
|
|
|
|
|
|
|
<https://github.com/grpc/grpc-go/tree/master/xds/internal/client>
|
2020-01-15 17:26:09 +01:00
|
|
|
: implements client for xDS - much of this code has been reused here.
|
2020-01-11 08:48:30 +01:00
|
|
|
|
|
|
|
|
To see if things are working start the testing control plane from go-control-plane:
|
2020-01-12 16:06:06 +01:00
|
|
|
|
2020-01-15 17:26:09 +01:00
|
|
|
* https://github.com/envoyproxy/envoy/blob/master/api/API_OVERVIEW.md
|
|
|
|
|
* https://github.com/envoyproxy/learnenvoy/blob/master/_articles/service-discovery.md
|
|
|
|
|
* This was really helpful: https://www.envoyproxy.io/docs/envoy/v1.11.2/api-docs/xds_protocol
|
2020-01-12 16:06:06 +01:00
|
|
|
|
|
|
|
|
Cluster: A cluster is a group of logically similar endpoints that Envoy connects to. In v2, RDS
|
|
|
|
|
routes points to clusters, CDS provides cluster configuration and Envoy discovers the cluster
|
|
|
|
|
members via EDS.
|
2020-01-13 11:21:20 +01:00
|
|
|
|
|
|
|
|
# Testing
|
|
|
|
|
|
|
|
|
|
~~~ sh
|
2020-01-15 17:26:09 +01:00
|
|
|
% cd ~/src/github.com/envoyproxy/go-control-plane/pkg/test/main
|
|
|
|
|
% go build
|
|
|
|
|
% ./main --xds=ads --runtimes=2 -debug
|
2020-01-13 11:21:20 +01:00
|
|
|
~~~
|
|
|
|
|
|
2020-01-15 17:26:09 +01:00
|
|
|
This runs a binary from pkg/test/main. Now we're testing aDS. Everything is using gRPC with TLS,
|
|
|
|
|
`grpc.WithInsecure()`. The binary runs on port 18000 on localhost; all these things are currently
|
|
|
|
|
hardcoded in the *traffic* plugin. This will be factored out into config as some point.
|
2020-01-13 11:21:20 +01:00
|
|
|
|
2020-01-15 17:26:09 +01:00
|
|
|
Then for CoreDNS, check out the `traffic` branch, create a Corefile:
|
2020-01-13 11:21:20 +01:00
|
|
|
|
2020-01-15 17:26:09 +01:00
|
|
|
~~~ Corefile
|
|
|
|
|
example.org {
|
|
|
|
|
traffic
|
|
|
|
|
debug
|
|
|
|
|
}
|
2020-01-13 11:21:20 +01:00
|
|
|
~~~
|
|
|
|
|
|
2020-01-15 17:26:09 +01:00
|
|
|
Start CoreDNS, and see logging/debugging flow by; the test binary should also spew out a bunch of
|
|
|
|
|
things. CoreDNS willl build up a list of cluster and endpoints. Next you can query it.
|
2020-01-14 09:10:21 +01:00
|
|
|
|
2020-01-15 17:26:09 +01:00
|
|
|
TODO
|