https://github.com/mikejoh/grpc-echo-service
A super simple gRPC example inspired by the official helloworld example from grpc.io
https://github.com/mikejoh/grpc-echo-service
grpc grpc-go helm kind kubernetes metallb
Last synced: about 1 year ago
JSON representation
A super simple gRPC example inspired by the official helloworld example from grpc.io
- Host: GitHub
- URL: https://github.com/mikejoh/grpc-echo-service
- Owner: mikejoh
- Created: 2021-04-27T19:40:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-04T07:17:15.000Z (almost 5 years ago)
- Last Synced: 2025-03-13T04:02:25.293Z (about 1 year ago)
- Topics: grpc, grpc-go, helm, kind, kubernetes, metallb
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gRPC echo service
_Heavily inspired by the official grpc [`helloworld`](https://grpc.io/docs/languages/go/quickstart/) example but with a fully working Kubernetes deployment example._
_Will only work on your machine._
The echo-service works as follows: The server will answer `pong` on any `ping` request sent using the gRPC client. The `pong` response and `ping` message are hardcoded in the server and client.
## Prerequisites
* Docker
* [`kind`](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
* `protoc` and Go plugins for the protocol compiler
* Go
## How to
1. See the prerequisites [here](https://grpc.io/docs/languages/go/quickstart/#prerequisites) to install `protoc` and the Go plugins needed.
2. In the root of this repository run:
```
make gen-proto
```
3. Start the `kind` cluster:
```
kind create cluster --name k8s-1.19.7 --config kind/k8s-1.19.7.yaml
```
4. Install `metallb` to be able to create a `Service` of type `LoadBalancer` in Kubernetes:
```
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/master/manifests/namespace.yaml
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/master/manifests/metallb.yaml
```
5. Identify the CIDR network used by Docker:
```
docker network inspect -f '{{.IPAM.Config}}' kind
```
6. Create and apply a `ConfigMap` using a subset of the addresses in the CIDR from the output above, you should replace the IP addresses `addresses` field below:
```
cat <