/platform-extras-skills:kubecost-cost-visibilityfrom platform-extras-skills
Guides deploying Kubecost in Kubernetes clusters to allocate cloud spend by namespace, workload, and label, build showback/chargeback reports, and inform autoscaling and rightsizing decisions.
Ships in platform-extras-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Cloud billing is emitted per node, per disk, per load balancer — never per pod, per namespace, or per team. On a shared Kubernetes cluster running dozens of workloads on the same node pool, that means the provider's cost dashboard tells you the cluster costs $40k/month but cannot tell you which of twenty teams' namespaces is responsible for how much of it. Kubecost closes that gap: it correlates node/PV/load-balancer pricing (from cloud provider billing APIs or custom pricing sheets) with actual Kubernetes resource requests and usage at the pod/container level, then rolls that up by namespace, label, deployment, or any other Kubernetes concept — turning an opaque node-level bill into per-team showback and chargeback numbers, and giving rightsizing and autoscaling decisions a cost dimension instead of just a utilization one. This skill is Kubernetes-specific allocation; for the broader cross-cloud FinOps practices (tagging discipline, commitment discounts, anomaly response) that Kubecost data feeds into, see the general FinOps skill referenced below.
bigquery.dataViewer.cost-analyzer Helm chart into a kubecost namespace.team, cost-center, environment labels) — Kubecost allocates
by whatever Kubernetes labels/annotations exist, so allocation quality
is only as good as label coverage. Reuse the same taxonomy as the
cross-cloud FinOps tagging convention rather than inventing a
Kubernetes-only one.Install Kubecost via Helm, pointing it at cloud billing for accurate node pricing:
helm repo add kubecost https://kubecost.github.io/cost-analyzer/
helm upgrade --install kubecost kubecost/cost-analyzer \
--namespace kubecost --create-namespace \
--set kubecostToken="<KUBECOST_TOKEN>" \
-f values-kubecost.yaml
values-kubecost.yaml (AWS example, using CUR for accurate pricing):
kubecostProductConfigs:
athenaProjectID: "<AWS_ACCOUNT_ID>"
athenaBucketName: "s3://<CUR_ATHENA_RESULTS_BUCKET>"
athenaRegion: "us-east-1"
athenaDatabase: "athenacurcfn_cur_report"
athenaTable: "cur_report"
masterPayerARN: "arn:aws:iam::<PAYER_ACCOUNT_ID>:role/<KUBECOST_ROLE>"
prometheus:
fqdn: "http://kube-prom-stack-prometheus.monitoring:9090" # federate existing Prometheus
enabled: false # don't install a second Prometheus if one already exists
Without a CUR/Cost Management/Billing-export connection, Kubecost falls back to public on-demand list pricing per instance type — usable for relative allocation between namespaces, but inaccurate for commitment-discounted or Spot-priced nodes.
Confirm allocation data is flowing before building reports:
kubectl port-forward -n kubecost svc/kubecost-cost-analyzer 9090:9090
curl "http://localhost:9090/model/allocation?window=1d&aggregate=namespace"
A response with non-zero cpuCost/ramCost/totalCost per namespace
confirms allocation is working; all-zero costs usually mean the
billing connection (step 1) isn't authenticated correctly yet.
Query allocation by namespace, label, or controller via the Allocation API for showback reporting:
# cost per namespace for the trailing 7 days
curl "http://localhost:9090/model/allocation?window=7d&aggregate=namespace"
# cost per team label, split out by cost type (cpu/ram/pv/network)
curl "http://localhost:9090/model/allocation?window=7d&aggregate=label:team&accumulate=true"
# cost per deployment within a namespace, for chargeback granularity
curl "http://localhost:9090/model/allocation?window=30d&aggregate=namespace,deployment&filter=namespace:payments"
Break out idle and shared cost explicitly rather than letting it silently inflate whichever namespace happens to be measured first:
curl "http://localhost:9090/model/allocation?window=7d&aggregate=namespace&idle=true&shareIdle=true&shareTenancyCosts=true"
shareIdle=true distributes unallocated (idle) node capacity
proportionally across active namespaces instead of leaving it as an
unattributed lump — decide with stakeholders whether idle cost should
be shared proportionally (fair to teams who scaled down) or charged
to a platform/shared-services cost center (clearer accountability for
who owns rightsizing the cluster's headroom).
Build a showback dashboard (Kubecost's built-in UI, or export to
Grafana via Kubecost's Prometheus metrics kubecost_cluster_management_cost,
container_cpu_allocation, etc.) broken down by the same team/
cost-center labels used in the cross-cloud FinOps showback view, so
Kubernetes cost isn't a separate silo from the rest of cloud spend.
Set up chargeback only once label coverage is reliably high
(>95% of pods carry the team/cost-center label) — enable
Kubecost's chargeback/invoicing report and reconcile it monthly
against the team's own understanding of their footprint before
treating the numbers as authoritative for internal billing.
Use request-vs-usage data to drive rightsizing, not just cost totals:
curl "http://localhost:9090/model/allocation?window=7d&aggregate=namespace&filter=namespace:payments" \
| jq '.data[0].payments | {cpuCost, cpuEfficiency, ramCost, ramEfficiency}'
A namespace with cpuEfficiency/ramEfficiency well below 50%
(requests far exceeding actual usage) is paying for idle headroom —
feed that back to the owning team as a rightsizing recommendation
with the dollar amount attached, which lands better than a raw
utilization percentage.
Feed cost signals into autoscaling/node-shape decisions. Query
Kubecost's cluster-level savings recommendations
(/model/savings/requestSizingV2) and cross-reference with node-pool
composition: workloads that are cost-sensitive and interruption-
tolerant are candidates for Spot-backed Karpenter NodePools; steady,
latency-sensitive workloads justify On-Demand or Reserved/Savings-
Plan-covered capacity. See
karpenter-cluster-autoscaling
for how consolidation and node-shape selection actually happen.
Symptom: Every namespace shows the same near-zero cost, or costs
don't change even after obviously scaling a workload up.
Fix: Kubecost isn't authenticated against real cloud billing and
is silently falling back to (or failing to reach) pricing data.
Verify the CUR/Cost Management/BigQuery billing connection
credentials and IAM role/permissions (step 1), and check the
kubecost-cost-model pod logs for pricing-API auth errors.
Symptom: A namespace's showback cost is far higher than the team
believes it should be, and they dispute the number.
Fix: Idle/shared cluster capacity is being allocated to that
namespace in a way the team wasn't told about (e.g.
shareIdle=true spreading unused node capacity across all active
namespaces including theirs). Make the idle-allocation policy explicit
and visible in the report itself, not just in the API parameters.
Symptom: Chargeback invoices generated from Kubecost data are
rejected by a team as inaccurate.
Fix: Label coverage was below the threshold needed for reliable
chargeback (pods without a team/cost-center label get bucketed
into an __unallocated__ catch-all that then gets redistributed
incorrectly). Run a label-coverage report first and fix coverage
before enabling chargeback, keeping it as showback in the meantime.
Symptom: Kubecost's own pods (cost-analyzer, bundled Prometheus)
consume a surprisingly large amount of the cluster's CPU/memory,
showing up as a new top-line cost themselves.
Fix: A second Prometheus was installed instead of federating the
existing one, doubling scrape/storage load. Set
prometheus.enabled: false and point prometheus.fqdn at the
existing kube-prometheus-stack instance.
Symptom: A rightsizing recommendation based on Kubecost's efficiency numbers is applied and the workload starts getting OOMKilled under peak load. Fix: Efficiency was computed from average usage over the query window, hiding periodic peaks (batch jobs, traffic spikes). Cross-check peak (not just average) usage — the same caution that applies to cloud-level rightsizing applies here; see cloud-cost-finops-optimization for the general principle.
Scenario: A platform team runs one shared EKS cluster for six product teams. The AWS bill for the cluster's node group is $28k/month, but there's no way to tell which team is responsible for how much of it, and finance wants a monthly chargeback report.
cpuCost + ramCost + pvCost roughly reconciles with the actual AWS
invoice for the node group over the same window.team label; the
remaining 8% (mostly cluster add-ons and a couple of unlabeled jobs)
are backfilled with labels before proceeding.aggregate=label:team&shareIdle=true&shareTenancyCosts=true
for the trailing 30 days, and present the breakdown as showback
first, giving each team two weeks to review and dispute their number
before switching to chargeback.checkout, disputes their number as high relative to their
traffic; the efficiency query shows cpuEfficiency: 18% — their
deployments request 4 CPU per pod but use under 1 CPU even at peak.
The team rightsizes requests down to 1.5 CPU, cutting their showback
cost by roughly 60% the following month.checkout's now-rightsized, traffic-
tolerant background workers onto a Spot-backed Karpenter NodePool,
further reducing their allocated node cost.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Kubernetes, AWS, GCP, Azure
kubecost, kubernetes-cost, cloud-cost-allocation, finops, showback, chargeback
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin platform-extras-skills16 skills in this plugin
/backstage-developer-portalGuides building an internal developer portal with Backstage — authoring catalog-info.yaml to register services in the software catalog, setting up TechDocs for docs-as-code, writing Software Templates to scaffold new services, and understanding the plugin architecture. Use when a user asks to "register a service in Backstage", "write a catalog- info.yaml", "set up TechDocs", "create a Backstage software template for scaffolding new repos", "add a Backstage plugin", or "build an internal developer portal."
/distributed-tracing-with-tempo-and-jaegerGuides configuring Grafana Tempo or Jaeger as the distributed tracing backend — trace storage backend selection and retention, sampling strategy at the backend/collector level (head-based vs. tail-based), and trace-to-metrics/trace-to-logs correlation so a trace ID can pivot directly into a log line or a metrics exemplar. Use when the user asks to "set up Tempo," "configure Jaeger storage," "set trace retention," "configure trace-to-logs correlation in Grafana," "design a sampling strategy for traces," or "query traces with TraceQL." This is the tracing *backend/storage* layer — instrumenting applications and configuring the OpenTelemetry Collector that feeds this backend is covered separately in opentelemetry-instrumentation-and-collector-configuration.
Other plugins' skills for the same job