This project uses envoys xDS api to stream upstream endpoints for dynamic configuration
Every new grpc service will call the register
rpc during startup and deregister
during shutdown.
The same is then streamed to envoy as endpoints to the cluster
-
Start the grpc server. The grpc server will run at port
8080
-
Now build run the envoy docker container
docker build -t eds-envoy .
docker run -p 8000:8000 -p 8081:8081 eds-envoy
- For registering a service we will make use of evans for grpc request
evans --host 127.0.0.1 --port 8080 --proto Register.proto --path .
Make sure that you run the command from inside proto
folder
In evans do the the following
service DiscoveryService
call register
Add values for ip and port. Make sure that ip is a valid one. Example -
ip -> 127.0.0.1
port -> 1234
Once the registeration is successful you should be able to curl within the container to see upstream clusters
curl localhost:8081/clusters
For deregistering
service DiscoveryService
call deregister
Add values for ip and port. Make sure that ip is a valid one. Example -
ip -> 127.0.0.1
port -> 1234
Once the deregisteration is successful check the upstream cluster