This is a simple gRPC project that demonstrates unary,client-server,bidirectional communication between a server and a client using Go programming language, while attempting a simple implementation of containerization and creating a pod/deployment.
client
: Contains the client-side code.server
: Contains the server-side code.proto
: Contains the Protocol Buffers definition file (greet.proto
) and generated gRPC code.go.mod
andgo.sum
: Go module files.Dockerfile
: Dockerfile for building Docker image containing both server and client.deployment.yaml
: Kubernetes Deployment file.service.yaml
: Kubernetes Service file.README.md
: Instructions and information about the project.
- Go programming language (https://golang.org/dl/)
- Docker (https://docs.docker.com/get-docker/)
- Kubernetes (https://kubernetes.io/docs/setup/)
-
Clone this repository:
git clone https://github.com/PraneGIT/gRPC-complete.git
-
Navigate to the project directory:
cd GRPC
-
Build and run the server:
cd server go run *.go
-
In another terminal window, build and run the client:
cd client go run *.go
-
Build the Docker images:
docker build -t grpc-app .
-
Tag the Docker image:
docker tag grpc-app <your-docker-username>/grpc-app:latest
-
Push the Docker image to Docker Hub:
docker push <your-docker-username>/grpc-app:latest
-
Run the Docker container:
docker run -p 8080:8080 grpc-app
-
Apply the Kubernetes manifests:
kubectl apply -f deployment.yaml kubectl apply -f service.yaml
-
Verify the deployment:
kubectl get pods kubectl get services