An open API service indexing awesome lists of open source software.

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

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 <