Skip to content

sreeharikmarar/grpc_dummy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC dummy

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.

Build the Application

To build the gRPC application, run:

make build

Clean Build Artifacts

To clean build artifacts, run:

make clean

Run Tests

make test

Install Dependencies

make get

Build Docker Image

To build a Docker image from the project, run:

make docker-build

Push Docker Image

To tag the Docker image and push it to a Docker registry, you need to run:

make docker-push

Run the Application

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

image

Deploy on K8s Environment

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/

Development

Pre-requisite

Protocol buffer installation

$: brew install protobuf
$: protoc --version  # Ensure compiler version is 3+

Server

go

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

Client

grpcui

$: grpcui --plaintext localhost:8080
gRPC Web UI available at http://127.0.0.1:51685/

About

gRPC dummy service for testing purpose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published