How jay240322/kubesense works
KubeSense is a web-based Kubernetes troubleshooting assistant. Users sign in, configure a Gemini key, inspect pod details, logs, and events, and request pod-level or cluster-wide AI analysis. The dashboard-facing hooks call the frontend API service; backend routes dispatch to Kubernetes access or analysis, and AI generation uses Gemini. Authentication and database access form supporting internal layers. README documents these major capabilities; some implementation files were not sampled, so uncertain connections are omitted.
Main entry points: api.ts API service · main.py FastAPI routes · page.tsx Dashboard · service.py AI response service
Components 27
Web dashboard
- Dashboard
frontend/app/dashboard/page.tsx - Pod explorer
frontend/components/podTable/podTable.tsx - Pod details
frontend/components/PodDetails/PodDetails.tsx - Pod logs
frontend/components/PodLogs/PodLogs.tsx - Pod events
frontend/components/PodEvents/PodEvents.tsx - Cluster analysis UI
frontend/components/ClusterAnalysis/ClusterAnalysis.tsx - Login form
frontend/components/auth/LoginForm.tsx - Auth context
frontend/context/AuthContext.tsx - Gemini settings UI
frontend/components/GeminiApiModal/GeminiApiModal.tsx - Analysis hooks
frontend/hooks/useAI.ts - Cluster hook
frontend/hooks/useClusterAI.ts - Settings hook
frontend/hooks/useGeminiSettings.ts - API service
frontend/services/api.ts
Backend API
- FastAPI routes
backend/app/main.py
Cluster diagnostics
- Pod operations
backend/app/kubernetes/pods.py - Kubernetes client
backend/app/kubernetes/client.py
Identity and settings
- Settings routes
backend/app/settings/router.py - Key lookup
backend/app/settings/service.py - Auth routes
backend/app/auth/router.py - Login service
backend/app/auth/service.py - PostgreSQL
backend/app/database.py
AI analysis
- Pod analyzer
backend/app/ai/analyzer.py - Cluster analyzer
backend/app/ai/cluster_analyzer.py - AI response service
backend/app/ai/service.py
Other components
- Engineer
- Kubernetes cluster
- Google Gemini
Connections 29
- Engineer → Dashboard: uses
- Dashboard → Pod explorer: shows
- Dashboard → Cluster analysis UI: shows
- Dashboard → Login form: offers login
- Login form → Auth context: stores token
- Pod explorer → API service: requests pod data
- Pod details → API service: requests details
- Pod logs → API service: requests logs
- Pod events → API service: requests events
- Analysis hooks → API service: requests analysis
- Cluster hook → API service: requests analysis
- Gemini settings UI → Settings hook: configures key
- Settings hook → API service: requests settings
- API service → FastAPI routes: calls API
- FastAPI routes → Pod operations: dispatches pod requests
- Pod operations → Kubernetes client: creates client
- Kubernetes client → Kubernetes cluster: queries cluster
- FastAPI routes → Pod analyzer: dispatches pod analysis
- FastAPI routes → Cluster analyzer: dispatches cluster analysis
- Pod analyzer → AI response service: generates analysis
- Cluster analyzer → AI response service: generates analysis
- AI response service → Key lookup: loads fallback key
- AI response service → Google Gemini: sends prompt
- FastAPI routes → Auth routes: includes routes
- Auth routes → Login service: calls login
- Login service → PostgreSQL: queries users
- FastAPI routes → Settings routes: includes routes
- Settings routes → Google Gemini: validates key
- Key lookup → PostgreSQL: reads settings