How hoango277/k8s-hub works
K8s Hub is an AI-assisted Kubernetes operations platform. Engineers use the web app to chat with an agent, inspect proposed cluster changes, and approve them through dry-run, execution, verification, and audit; separate workflows provide RCA and reusable skills. The backend also gathers cluster evidence from observability integrations and traces LLM activity to Langfuse. The graph emphasizes documented product workflows and relationships visible in the supplied excerpts or source index; unsampled implementation details are not expanded into asserted call chains.
Main entry points: agent.py Chat agent · router.py API router · route.ts Backend proxy · pipeline.py RCA pipeline
Components 25
Web application
- Chat UI
frontend/src/app/(app)/chat/page.tsx - Approvals UI
frontend/src/app/(app)/approvals/page.tsx - RCA UI
frontend/src/app/(app)/rca/page.tsx - Skills UI
frontend/src/app/(app)/skills/page.tsx - Backend proxy
frontend/src/app/api/backend/[...path]/route.ts
API and services
- FastAPI app
backend/app/main.py - API router
backend/app/api/router.py - Chat endpoint
backend/app/api/v1/chat.py - Approval endpoints
backend/app/api/v1/approvals.py - RCA endpoints
backend/app/api/v1/rca.py - Skills endpoints
backend/app/api/v1/skills.py
Agent and tools
- Chat agent
backend/app/modules/nl_command/agent.py - Input safeguards
backend/app/modules/nl_command/injection.py - Tool registry
backend/app/modules/tools/registry.py - Tool definitions
backend/app/modules/tools/schema.py - Change approval flow
backend/app/services/approval_service.py - Skill runtime
backend/app/modules/skills
RCA
- RCA pipeline
backend/app/modules/rca/pipeline.py - RCA report
backend/app/modules/rca/report.py
Data and integrations
- LLM client
backend/app/integrations/llm/client.py - PostgreSQL data
backend/app/db/session.py - Cluster observability
backend/app/integrations - Langfuse tracing
backend/app/modules/observability/langfuse_client.py
Other components
- Engineer
- Kubernetes cluster
Connections 29
- Engineer → Chat UI: asks
README.md - Chat UI → Backend proxy: sends requests
- Approvals UI → Backend proxy: sends requests
- RCA UI → Backend proxy: sends requests
- Skills UI → Backend proxy: sends requests
- Backend proxy → FastAPI app: forwards requests
- FastAPI app → API router: mounts
backend/app/main.py - API router → Chat endpoint: routes
backend/app/api/router.py - API router → Approval endpoints: routes
backend/app/api/router.py - API router → RCA endpoints: routes
backend/app/api/router.py - API router → Skills endpoints: routes
backend/app/api/router.py - Chat endpoint → Chat agent: invokes
backend/app/api/v1/chat.py - Chat endpoint → PostgreSQL data: loads threads
backend/app/api/v1/chat.py - Chat agent → LLM client: gets model
backend/app/modules/nl_command/agent.py - Chat agent → Input safeguards: uses
backend/app/modules/nl_command/agent.py - Chat agent → Tool registry: looks up tools
backend/app/modules/nl_command/agent.py - Tool registry → Tool definitions: builds specs
backend/app/modules/tools/registry.py - Chat agent → Change approval flow: proposes changes
- Change approval flow → PostgreSQL data: stores audit state
backend/app/services/approval_service.py - Approval endpoints → Change approval flow: calls service
backend/app/api/v1/approvals.py - Change approval flow → Kubernetes cluster: executes approved change
- Engineer → Approvals UI: reviews changes
README.md - RCA endpoints → RCA pipeline: starts diagnosis
- RCA pipeline → Cluster observability: collects evidence
- RCA pipeline → PostgreSQL data: saves analysis
backend/app/modules/rca/pipeline.py - RCA pipeline → RCA report: optionally reports
backend/app/modules/rca/pipeline.py - Engineer → RCA UI: reviews diagnosis
README.md - Skills endpoints → Skill runtime: uses skills
- Chat agent → Langfuse tracing: traces activity