Cost Analysis
ops0 integrates with OpenCost to provide real-time cost visibility for your Kubernetes clusters. You can see cost breakdowns by namespace, pod, and controller, track resource efficiency, and link costs back to IaC projects.
Overview
The Kubernetes Cost Analysis feature answers questions like: how much does each namespace cost per month? Which pods are over-provisioned? How efficient is our CPU and memory usage? Where should we right-size?
Namespace Costs
Monthly cost breakdown by namespace
Resource Efficiency
CPU and memory utilization tracking
IaC Linking
Connect costs to infrastructure projects
Cost Report
The cost report is available from the cluster detail page. Click Cost Report to open the analysis modal.
Allocation View
The allocation view breaks down costs by namespace, pod, or controller.
| Metric | Description |
|---|---|
| CPU Cost | Compute cost based on CPU allocation |
| Memory Cost | Cost based on memory allocation |
| GPU Cost | GPU resource costs (if applicable) |
| PV Cost | Persistent volume storage costs |
| Network Cost | Network transfer costs |
| Total Cost | Sum of all cost components |
Efficiency Metrics
| Metric | Description |
|---|---|
| CPU Efficiency | Ratio of CPU used vs. CPU requested |
| Memory Efficiency | Ratio of memory used vs. memory requested |
| Provisioned CPU | Total CPU allocated to the namespace/pod |
| Used CPU | Actual CPU consumed |
| Provisioned Memory | Total memory allocated |
| Used Memory | Actual memory consumed |
Time Windows
You can analyze costs over different time periods:
| Window | Description |
|---|---|
| 24h | Last 24 hours |
| 7d | Last 7 days |
| 30d | Last 30 days |
| Custom | Custom date range |
Aggregation Levels
| Level | Description |
|---|---|
| Namespace | Cost per Kubernetes namespace |
| Pod | Cost per individual pod |
| Controller | Cost per deployment/statefulset/daemonset |
IaC Project Linking
ops0 can detect which IaC project provisioned a Kubernetes cluster and link cost data back to the project. This gives you end-to-end visibility from infrastructure code to running costs.
| Confidence | Description |
|---|---|
| High | Direct match between cluster and IaC project resource |
| Medium | Probable match based on naming conventions |
| Low | Possible match, manual verification recommended |
Asset View
The asset view shows node-level cost data:
| Field | Description |
|---|---|
| Node Name | Kubernetes node identifier |
| Instance Type | Cloud provider machine type |
| CPU Cost | Node compute cost |
| Memory Cost | Node memory cost |
| Total Cost | Combined node cost |
GCP Pricing
For GCP clusters, ops0 uses the GCP Pricing API for accurate cost data. Configure your GCP_PRICING_API_KEY in the environment to enable this.
Cost analysis requires OpenCost to be installed in your cluster. ops0 can install OpenCost for you from the cluster management page, or you can install it manually using Helm.