How saikireetigandham/k8s-dashboard works
Kubernetes Dashboard is a demo-oriented Next.js interface for inspecting cluster state and performing operational workflows. Users browse resource and overview pages, retrieve cluster data through the UI API client and route handlers, and view results; operational actions also mutate resources. The backend supports both synthetic in-memory demo state and live Kubernetes access, with separate metrics and AI-workload views. The README documents additional resource areas whose individual page-to-route wiring was not sampled, so those links are shown only where supported by the README or source index.
Main entry points: api-client.ts UI API client · k8s-store.ts Demo cluster store · workloads/route.ts Workload routes · autoscaling/route.ts Autoscaling route
Components 22
Dashboard UI
- Dashboard pages
src/app/page.tsx - Resource views
src/app - Operational tools
src/components - Dashboard layout
src/components/dashboard-layout.tsx - UI API client
src/lib/api-client.ts - Demo authentication
src/contexts/auth-context.tsx - Resource search
src/components/enhanced-search.tsx - Terminal and logs
src/components/xterm-terminal.tsx
API Routes
- Resource routes
src/app/api - Workload routes
src/app/api/workloads/route.ts - Autoscaling route
src/app/api/autoscaling/route.ts - AI workloads route
src/app/api/ai-workloads/route.ts - Action route
src/app/api/actions/route.ts - Pod exec route
src/app/api/exec/route.ts
Cluster Access
- Kubernetes config
src/lib/k8s-client.ts - Demo cluster store
src/lib/k8s-store.ts - Synthetic data
src/lib/demo-data.ts
Metrics and AI
- Realtime hooks
src/hooks - Metrics client
src/lib/metrics-client.ts - AI inventory page
src/app/ai-workloads/page.tsx
Other components
- Cluster operator
- Kubernetes cluster
Connections 25
- Cluster operator → Dashboard pages: opens dashboard
README.md - Dashboard pages → Dashboard layout: renders through
src/components/dashboard-layout.tsx - Cluster operator → Resource views: explores resources
README.md - Resource views → UI API client: requests cluster data
src/app/api/gateways/route.ts - Dashboard layout → UI API client: requests cluster data
src/components/dashboard-layout.tsx - UI API client → Resource routes: fetches resource routes
src/lib/api-client.ts - UI API client → Workload routes: fetches workloads
src/lib/api-client.ts - UI API client → Autoscaling route: fetches autoscaling
src/lib/api-client.ts - UI API client → AI workloads route: fetches AI inventory
src/lib/api-client.ts - Workload routes → Kubernetes cluster: lists cluster workloads
src/app/api/workloads/route.ts - Workload routes → Demo cluster store: reads demo workloads
src/app/api/workloads/route.ts - Autoscaling route → Kubernetes config: gets cluster config
src/app/api/autoscaling/route.ts - Autoscaling route → Kubernetes cluster: lists autoscalers
src/app/api/autoscaling/route.ts - AI workloads route → Kubernetes config: gets cluster config
src/app/api/ai-workloads/route.ts - AI workloads route → Kubernetes cluster: lists nodes and pods
src/app/api/ai-workloads/route.ts - Action route → Kubernetes cluster: performs resource actions
src/app/api/actions/route.ts - Action route → Demo cluster store: applies demo actions
src/app/api/actions/route.ts - Pod exec route → Demo cluster store: runs demo commands
src/app/api/exec/route.ts - Operational tools → UI API client: uses API access
src/components/dashboard-layout.tsx - Resource search → Resource views: navigates to views
src/components/enhanced-search.tsx - Terminal and logs → Pod exec route: requests pod exec
- Realtime hooks → Metrics client: subscribes to metrics
src/hooks/use-real-time-metrics.ts - AI inventory page → UI API client: loads AI inventory
- Demo authentication → Dashboard pages: gates access
- Synthetic data → Demo cluster store: supplies demo state