ClusterCost Dashboard is an open-source, local-first observability surface for real-time Kubernetes cost visibility. It runs a lightweight Go backend with an embedded React + Vite frontend, talks directly to ClusterCost agents, and ships with Docker and Kubernetes deployment assets.
- Go backend with cached polling of ClusterCost agents.
- React + Vite + Tailwind + shadcn/ui frontend with a collapsible sidebar, responsive cards, and mobile-friendly tables.
- REST API:
/api/overview,/api/namespaces,/api/pods,/api/nodes,/api/workloads,/api/agents,/api/health. - Multi-stage Dockerfile and Kubernetes manifests for quick deployment.
- Modern chart utilities powered by shadcn blocks so every dashboard (Overview, Namespaces, Nodes, Resources) shares the same look & feel.
- Go 1.21+
- Node.js 18+
- ClusterCost agents reachable from the dashboard
Set agents via CONFIG_FILE (YAML) or a comma-separated AGENT_URLS env variable.
listenAddr: ":8080"
pollInterval: 30s
agents:
- name: prod-cluster
baseUrl: http://clustercost-agent-k8s.prod.svc.cluster.local:8080
type: k8sEnvironment overrides:
| Variable | Description |
|---|---|
LISTEN_ADDR |
HTTP listen address (default :9090) |
POLL_INTERVAL |
Poll frequency, e.g. 30s |
CONFIG_FILE |
Path to YAML config |
AGENT_URLS |
Comma-separated agent base URLs (k8s) |
LISTEN_ADDR=:9090 go run ./cmd/dashboardcd web
npm install
npm run devThe Vite dev server proxies API calls to localhost:8080. When you run npm run build, the generated assets are automatically copied into internal/static/dist so the Go binary can embed the latest frontend.
The dashboard polls each configured agent via the /agent/v1/* endpoints for health & cost data. Review AGENTS.md for payload details and tips on running agents locally.
docker build -f deployments/docker/Dockerfile -t clustercost/dashboard .
docker run -p 8080:8080 clustercost/dashboardApply the ConfigMap, Deployment, and Service in deployments/k8s/ after updating the agent URL to match your cluster.
kubectl apply -f deployments/k8s/configmap.yaml
kubectl apply -f deployments/k8s/deployment.yaml
kubectl apply -f deployments/k8s/service.yamlcmd/dashboard: Go entrypoint.internal: configuration, agent client, cache, API handlers, static serving.web: React frontend.deployments: Docker and Kubernetes artifacts.AGENTS.md: documentation for the expected agent API payloads.
MIT © ClusterCost