Skip to content

Kubernetes (OpenCost)

  • Cluster cost by namespace and workload, with pod labels

Method: Plutus Agent (Helm install)

Unlike every other cost source, Plutus doesn’t pull this data — your cluster is behind your firewall, and Plutus can’t reach an in-cluster API from outside it. Instead, you install a small agent that reads OpenCost’s already-computed allocation data (OpenCost is a free CNCF project — the same engine behind Azure’s own AKS cost analysis) and pushes it out to Plutus over HTTPS. Plutus runs no other code inside your cluster and needs no inbound access to it.

  1. In Plutus, go to Sources, open the Cost tab, select Kubernetes, and click Generate API Key. This requires an account admin — a member can view the panel but won’t see this button.

  2. Plutus shows the key once, along with a ready-to-run install command:

    Terminal window
    helm install plutus-collector oci://ghcr.io/plutus-cloud/charts/plutus-collector \
    --namespace plutus-collector --create-namespace \
    --set clusterName=<your-cluster-name> \
    --set currency=<ISO-4217-code> \
    --set apiKey=<the key shown above>

    Replace clusterName with whatever you want this cluster called in Plutus, and currency with the ISO 4217 code your cluster’s costs are priced in — OpenCost doesn’t report a currency anywhere in its own output, so Plutus never assumes USD here. This installs OpenCost as a bundled subchart (if you don’t already run it — see the optional step below) plus the pusher itself, and cost data starts arriving within one push cycle (daily by default).

  3. Tracking more than one cluster? Run the same command again in each one — a single API key covers every cluster that pushes with it, and each push identifies its own cluster.

  4. Optional — already running OpenCost yourself? Point the chart at it instead of installing a second copy:

    Terminal window
    helm install plutus-collector oci://ghcr.io/plutus-cloud/charts/plutus-collector \
    --namespace plutus-collector --create-namespace \
    --set opencost.enabled=false \
    --set opencost.endpoint=http://opencost.<your-namespace>.svc.cluster.local:9003 \
    --set clusterName=<your-cluster-name> \
    --set currency=<ISO-4217-code> \
    --set apiKey=<the key shown above>
  5. Optional — to avoid putting the API key in Helm values/history, create the Secret yourself first and point the chart at it instead:

    Terminal window
    kubectl create secret generic plutus-collector-key \
    --namespace plutus-collector \
    --from-literal=api-key=<the key shown above>
    helm install plutus-collector oci://ghcr.io/plutus-cloud/charts/plutus-collector \
    --namespace plutus-collector --create-namespace \
    --set clusterName=<your-cluster-name> \
    --set currency=<ISO-4217-code> \
    --set existingSecret=plutus-collector-key
  6. Once the agent’s first push succeeds, the connection panel in Plutus shows Receiving data with the last push time. If it still shows “No data received yet” after a few minutes, check the agent’s pod logs (structured JSON, one line per push cycle) for the error, or its /metrics endpoint’s plutus_collector_last_push_success value.

Kubernetes costs are an allocation of spend you are already paying your cloud provider, so they are shown as a breakdown by namespace and workload and deliberately do not add to your account total — that money is already counted under AWS, GCP or Azure. Figures come from OpenCost’s own pricing, which does not account for negotiated discounts, committed-use discounts or savings plans, so they read high against a discounted bill. Unallocated and idle cluster capacity is shown rather than hidden.

Because the agent pushes data, Plutus reports its state from the pushes it receives, not from sync runs.

Collector state Meaning
sending_data The agent has sent a heartbeat within twice the push interval and its last push carried rows.
connected_no_data The agent is sending heartbeats, but its last push was empty or no rows have landed within twice the push interval.
silent No heartbeat within twice the push interval. The agent has stopped reaching Plutus.

The connection’s health value is working when rows have landed and the last push wasn’t empty, no_data when the agent is pushing but nothing usable has landed, and unknown when no push has ever reached Plutus. A silent agent keeps its last health value and is flagged overdue.

Two consecutive empty pushes open a Sync failures alert, with the agent’s reported reason and any failing preflight checks. The alert closes when a push carries rows. An agent that is fully silent raises no alert, since nothing arrives to trigger the check. Watch for the silent state or the overdue flag instead.

Each push replaces only the clusters it contains, for the days it covers. A push from one cluster doesn’t overwrite another cluster’s data, even when both clusters use the same API key.

The breakdown by namespace and workload includes an efficiency figure: how much of the CPU and memory a workload requested it actually used. It is weighted by cost, so a workload’s CPU and memory shares count in proportion to what each costs. Cost Explorer also shows used and wasted dollars per cluster.

  • Efficiency is a measurement. Plutus doesn’t produce a rightsizing recommendation from it.
  • Spend with no request and usage figures isn’t counted as 0%. Those rows show “—”, and each row states what share of its spend the figure covers.
  • Efficiency needs the Plutus Agent. It isn’t available for EKS cost that comes from split cost allocation (below).

An EKS cluster on EC2 can show cost by cluster, namespace, and workload with no agent installed. This uses AWS split cost allocation data from your AWS CUR 2.0 export.

  • The export must be created with Include split cost allocation data on. This can’t be added to an existing export.
  • Split cost allocation data must also be enabled for the payer account in AWS. AWS doesn’t backfill it.
  • ECS and AWS Batch lines are skipped.
  • Needs a plan with resource-level cost (Starter or above).
  • While a Kubernetes agent is connected, the split-cost-allocation breakdown is suppressed. The agent’s data is shown instead.