How arturobp3/distributed_grpc_system_k8s works
Project Type and Purpose
• This is a microservices proof‑of‑concept focusing on two Python gRPC services (servicio_a and servicio_b) packaged in Docker and deployed via Kubernetes (Minikube).
• servicio_b implements a basic greeting service; servicio_a acts as a gRPC client to servicio_b, adds user interaction, and exposes its own gRPC endpoint for testing.
File Structure
• Top level
• README.md – project overview & run instructions
• k8s/ – Kubernetes deployment & service manifests for both microservices
• protos/ – canonical .proto definitions for base and personalized greetings
• servicio_b/
• Dockerfile, server.py, saludo_base.proto → exposes SayHello RPC on port 50052
• servicio_a/
• Dockerfile, server.py, client.py, saludo_personalizado.proto & imported base stubs → listens on port 50051 and forwards calls to servicio_b
• venv/ – isolated Python environment
Readme Insights
• Sequence: generate stubs from .proto → build Docker images → start Minikube → kubectl apply manifests → expose servicio-a for local client testing.
• No external databases, purely in‑cluster gRPC calls.
Main Components & Interactions
a. Components
• Client (local Python script or external tester)
• servicio_a Pod (gRPC server+client)
• servicio_b Pod (gRPC server)
• Kubernetes Service objects (ClusterIP)
• Docker images & Minikube cluster
b. Relationships
1. Client → gRPC call to servicio_a (port 50051 exposed via k8s Service)
2. servicio_a → gRPC call to servicio_b (port 50052 via k8s Service)
3. servicio_b processes and returns greeting
4. servicio_a returns final greeting to client
c. Architectural Patterns
• Microservices (single‑responsibility services)
• RPC communication (gRPC over HTTP/2)
• Containerization & orchestration (Docker + Kubernetes)
d. Technologies & Frameworks
• Python 3.10+, grpcio, protobuf
• Docker (per‑service images)
• Kubernetes manifests (Deployment, Service)
• Minikube for local cluster