https://github.com/alextanhongpin/linkerd-grpc
Demonstrates the basic of load balancing gRPC with linkerd
https://github.com/alextanhongpin/linkerd-grpc
grpc linkerd
Last synced: about 1 year ago
JSON representation
Demonstrates the basic of load balancing gRPC with linkerd
- Host: GitHub
- URL: https://github.com/alextanhongpin/linkerd-grpc
- Owner: alextanhongpin
- Created: 2018-04-11T07:17:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-13T04:02:38.000Z (about 8 years ago)
- Last Synced: 2025-01-29T21:52:51.390Z (over 1 year ago)
- Topics: grpc, linkerd
- Language: Makefile
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# linkerd-grpc
The repository demonstrates on how to do a simple linker-to-service load balancing:
- linker-to-linker-no-tls (through namerd)
- linker-to-service
- linker-to-service-through-namerd
## Proto Example
```protobuf
syntax = "proto3";
package echo;
service Echo {
rpc Greet (GreetRequest) returns (GreetResponse) {}
}
message GreetRequest {
string text = 1;
}
message GreetResponse {
string text = 1;
}
```
## Run
We have a pre-built nodejs grpc image for both the server and client.
```bash
$ docker-compose up -d
```
## Validate Client
```bash
$ docker logs $(docker ps -a -q --filter name=client)
```
Output:
```bash
greeting from 7203bbf57d87: Hello, John Doe
```
## Validate Server
```bash
$ docker logs $(docker ps -a -q --filter name=server)
```
Output:
```bash
7203bbf57d87 listening to port 0.0.0.0:50051. press ctrl + c to cancel.
got metadata: secret {"_internal_repr":{"authorization":["secret"],"user-agent":["grpc-node/1.10.1 grpc-c/6.0.0-pre1 (linux; chttp2; glamorous)"],"l5d-dst-service":["/grpc/echo.Echo/Greet"],"via":["h2 linkerd"],"l5d-dst-client":["/$/inet/server/50051"],"l5d-dst-residual":["/echo/Greet"],"l5d-ctx-trace":["T1qG2D+FkK4T0LfTj5bJRBPQt9OPlslEAAAAAAAAAAA="],"l5d-reqid":["13d0b7d38f96c944"]}}
```