Chargeback
Attribute spend to teams, cost centers, namespaces and node pools with the labels you already use — in KubeHero, in Prometheus and in Grafana.
Chargeback is allocation grouped by who pays. KubeHero reads ownership from labels you already have, so there's no new configuration layer.
Labels
| Label (default) | Meaning | Override |
|---|---|---|
kubehero.io/team | the owning team — the primary chargeback axis | chargeback.teamLabel |
kubehero.io/cost-center | an optional business unit / cost center | chargeback.costCenterLabel |
| node pool (auto-detected per cloud) | eks.amazonaws.com/nodegroup, cloud.google.com/gke-nodepool, agentpool | chargeback.nodepoolLabel |
Pods without a team label fall back to chargeback.namespaceToTeam (e.g. kube-system: platform), then to chargeback.defaultTeam (unattributed) — unallocated spend stays visible instead of disappearing.
apiVersion: apps/v1
kind: Deployment
metadata:
name: checkout-api
spec:
template:
metadata:
labels:
kubehero.io/team: payments
kubehero.io/cost-center: commerceIn KubeHero
kubehero cost allocation --aggregate team --window month --idle --share-idle weighted
kubehero cost allocation --aggregate team,nodepool --window lastmonth
kubehero cost timeseries --group-by team --window 30d
kubehero cost export --format focus --window lastmonth --aggregate workload --file chargeback.csvTeam rows include CPU, RAM, GPU and network cost, log volume, idle cost shared back, and what rightsizing would recover — see Cost allocation. The dashboard's chargeback page shows the same by team and cost center, with a cloud split.
In Prometheus and Grafana
The collector exports per-pod kubehero_pod_cost_usd_per_second and kubehero_pod_recoverable_usd_per_second with team, cost_center, nodepool, cloud, region and gpu_kind labels. The chart's recording rules roll them up:
kubehero:team_cost_usd:rate1h # $/hour per team
kubehero:team_cost_usd:rate30d # projected 30-day spend per team
kubehero:nodepool_cost_usd:rate1h
kubehero:cost_center_cost_usd:rate1h
kubehero:team_gpu_idle_cost_usd:rate1h
kubehero:team_recoverable_usd:rate1hWith kube-prometheus-stack, the chart also ships Grafana dashboards — Chargeback by team, Fleet and GPU — as ConfigMaps picked up by the Grafana sidecar:
grafana:
dashboards:
chargeback: true
fleet: true
gpu: falseSee Prometheus + Grafana and the metrics reference.
Budgets
Put a BudgetPolicy on a team's namespaces to get threshold alerts (50 / 80 / 95 / 100%) and, if you arm it, an escalation plan — see the CRD reference. The default Budget burn over 1.5× alert rule watches every BudgetPolicy (Alerting).
Concepts
Attribution, signals, rightsizing, ceilings and guarded automation — the ideas the rest of KubeHero is built from.
Compatibility
Point Grafana, Promtail, Grafana Alloy, Fluent Bit, the OpenTelemetry Collector, Pyroscope SDKs, OpenCost clients, FinOps tools, Alertmanager and MCP clients at KubeHero — with config snippets.