A Go project that serves as an example of a gRPC-based application. It includes a Dockerfile and a Makefile for building, testing, and running the application inside a Docker container.
To build the gRPC application, run:
make build
To clean build artifacts, run:
make clean
make test
make get
To build a Docker image from the project, run:
make docker-build
To tag the Docker image and push it to a Docker registry, you need to run:
make docker-push
To run the application, you need to run:
SERVER_PORT=8080 ./grpc-dummy
Use grpc-ui to connect to the application
$: grpcui --plaintext localhost:8080
gRPC Web UI available at http://127.0.0.1:61120/
Access the application on http://127.0.0.1:61120/ , you will see
kubectl apply -f k8s/deployment.yaml
Use kubectl port forward
kubectl port-forward svc/grpc-dummy -n default 8080:8080
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
User grpc-ui to connect
grpcui --plaintext localhost:8080
gRPC Web UI available at http://127.0.0.1:62290/
$: brew install protobuf
$: protoc --version # Ensure compiler version is 3+
Generate a server interface
$: protoc --go_out=. --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=. proto/customer_service.proto
Start Server
$ SERVER_PORT=8080 go run server/go/server.go
$: grpcui --plaintext localhost:8080
gRPC Web UI available at http://127.0.0.1:51685/