https://github.com/rohancyberops/grpc-k8s-go-project
This project demonstrates a distributed system using gRPC, Kubernetes, and Go. It includes a simple gRPC service, a client, and deployment to Kubernetes for scalability.
https://github.com/rohancyberops/grpc-k8s-go-project
awasome distributed docker go golang grpc kubrnetes protocolbuf
Last synced: 12 months ago
JSON representation
This project demonstrates a distributed system using gRPC, Kubernetes, and Go. It includes a simple gRPC service, a client, and deployment to Kubernetes for scalability.
- Host: GitHub
- URL: https://github.com/rohancyberops/grpc-k8s-go-project
- Owner: RohanCyberOps
- License: mit
- Created: 2025-02-15T15:23:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-15T15:27:07.000Z (over 1 year ago)
- Last Synced: 2025-07-04T22:46:04.589Z (12 months ago)
- Topics: awasome, distributed, docker, go, golang, grpc, kubrnetes, protocolbuf
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gRPC + Kubernetes + Go Distributed System
## Overview
This project demonstrates a distributed system using **gRPC**, **Kubernetes**, and **Go**. It includes a simple gRPC service, a client, and deployment to Kubernetes for scalability.
## Technologies Used
- **Go (Golang)** - Statically typed, compiled programming language.
- **gRPC** - High-performance Remote Procedure Call (RPC) framework.
- **Protocol Buffers (Protobuf)** - Efficient data serialization format.
- **Docker** - Containerization for microservices.
- **Kubernetes** - Container orchestration platform.
## Prerequisites
Ensure you have the following installed:
- **Go** (≥1.20) - [Download Go](https://go.dev/dl/)
- **Docker** - [Download Docker](https://www.docker.com/)
- **Kubernetes** (Minikube, Kind, or a cloud provider)
- **protoc** (Protocol Buffers compiler) - [Install protoc](https://grpc.io/docs/protoc-installation/)
## Setup & Installation
### 1. Clone the Repository
```bash
git clone https://github.com/RohanCyberOps/grpc-k8s-go-project.git
cd grpc-k8s-go-project
```
### 2. Generate gRPC Code
```bash
protoc --go_out=. --go-grpc_out=. proto/helloworld.proto
```
### 3. Run the gRPC Server Locally
```bash
go run server/server.go
```
### 4. Run the gRPC Client
```bash
go run client/client.go
```
## Running with Docker
### 1. Build Docker Image
```bash
docker build -t greeter-server:latest -f Dockerfile .
```
### 2. Run Container
```bash
docker run -p 50051:50051 greeter-server
```
## Deploy to Kubernetes
### 1. Start Kubernetes Cluster
```bash
minikube start
```
### 2. Deploy gRPC Server to Kubernetes
```bash
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
```
### 3. Get Service IP
```bash
kubectl get svc greeter-service
```
### 4. Update Client to Use Kubernetes Service IP
Modify `client.go` to use `EXTERNAL-IP:50051`, then run:
```bash
go run client/client.go
```
## Scaling & Monitoring
### 1. Scale Pods
```bash
kubectl scale deployment greeter-server --replicas=5
```
### 2. Monitor Logs
```bash
kubectl logs -l app=greeter-server --tail=50 -f
```
## License
This project is licensed under the MIT License.