How stefanprodan/podinfo works
Podinfo is a Go microservice demo for exercising Kubernetes-facing service behavior. The main workflow starts the configured HTTP and optional gRPC servers; callers use health/readiness probes or API endpoints, which return runtime data, simulate faults and delays, or interact with configured backends and storage. The README documents a broad HTTP and gRPC surface, while the sampled server code shows HTTP route registration and gRPC service registration. Some handler implementations were not sampled, so their internal dependencies are not inferred.
Main entry points: http/server.go HTTP server · main.go Podinfo process · grpc/server.go gRPC server · cache.go Redis cache
Components 19
Runtime
- Podinfo process
cmd/podinfo/main.go
HTTP API
- HTTP server
pkg/api/http/server.go - HTTP responses
pkg/api/http/http.go - Runtime info
pkg/api/http/info.go - Health and readiness
pkg/api/http/health.go - Metrics
pkg/api/http/metrics.go - Fault controls
pkg/api/http/fault_injection.go - HTTP API handlers
pkg/api/http - Redis cache
pkg/api/http/cache.go - Disk store
pkg/api/http/store.go - Backend echo
pkg/api/http/echo.go
gRPC API
- gRPC server
pkg/api/grpc/server.go - gRPC services
pkg/api/grpc
Operations
- Shutdown signals
pkg/signals/shutdown.go - Config file cache
pkg/fscache/fscache.go - Pod CLI
cmd/podcli/ws.go
Other components
- API caller
- Redis
- Backend service
Connections 19
- Podinfo process → HTTP server: starts
cmd/podinfo/main.go - Podinfo process → gRPC server: starts
cmd/podinfo/main.go - Podinfo process → Shutdown signals: configures shutdown
cmd/podinfo/main.go - API caller → HTTP server: sends HTTP
- API caller → gRPC server: calls gRPC
- HTTP server → Runtime info: routes to
pkg/api/http/server.go - HTTP server → Health and readiness: routes to
pkg/api/http/server.go - HTTP server → Metrics: routes to
pkg/api/http/server.go - HTTP server → Fault controls: routes to
pkg/api/http/server.go - HTTP server → HTTP API handlers: routes to
pkg/api/http/server.go - HTTP server → Redis cache: routes to
pkg/api/http/server.go - HTTP server → Disk store: routes to
pkg/api/http/server.go - HTTP server → Backend echo: routes to
pkg/api/http/server.go - Redis cache → Redis: reads and writes
pkg/api/http/cache.go - Backend echo → Backend service: forwards request
pkg/api/http/echo.go - gRPC server → gRPC services: registers services
pkg/api/grpc/server.go - HTTP server → Config file cache: uses
pkg/api/http/server.go - API caller → Pod CLI: runs commands
- Pod CLI → HTTP server: opens WebSocket