Useful Kubecost Integration Information
• | CBI Mapping |
• | Usage Metrics |
• | Additional Tags for Kubernetes Costs |
• | Repositories |
• | Savings Recommendations |
The following table lists the CBI mapping automatically from the CSV column to cost dimensions/measures:
CSV Column |
Dimensions/Measures |
Required |
Meaning |
|||||||||
Cluster |
|
Yes |
Kubernetes cluster name. |
|||||||||
Namespace |
Resource Group |
Yes |
Kubernetes cluster namespace name. |
|||||||||
Aggregation |
Resource Type |
Yes |
Desired aggregation level for cost allocation data to be collected, controlled by an input parameter for the export utility. Supported values are namespace, controller, and pod. Recommended level is pod. |
|||||||||
Controller |
- |
Yes |
Controller name. A value is populated if a unique value is available for the used aggregation level. |
|||||||||
Pod |
- |
Yes |
Pod ID. A value is populated if a unique value is available for the used aggregation level. |
|||||||||
Container |
- |
Yes |
Container name. A value is populated if a unique value is available for the used aggregation level. |
|||||||||
Node |
- |
Yes |
Node name. A value is populated if a unique value is available for the used aggregation level. |
|||||||||
ResourceID |
Resource ID |
Yes |
Kubernetes resource ID. Based on the aggregation level, the resource ID pattern is as follows:
|
|||||||||
Cost |
Cost |
Yes |
The total cost for this record in the currency specified by Currency. |
|||||||||
Currency |
Currency Code |
Yes |
The currency code defined in Kubecost configuration. |
|||||||||
UsageType |
Usage Type |
Yes |
Represents the kind of usage incurred. For example, CPU usage, persistent volume usage, and so on. Sample values are cpuCost, ramCost, pvCost. |
|||||||||
UsageAmount |
Usage Amount |
Yes |
The amount of usage generated for this record. |
|||||||||
UsageUnit |
Usage Unit |
Yes |
The units that the Usage Amount metric is reported in. Sample values are cpuCoreHours, ramByteHours, pvBytesHours. |
|||||||||
ControllerKind |
- |
Yes |
A kind of controller. A value is populated if a unique value is available for the used aggregation level. Sample values are deployment, job, statefulset. |
|||||||||
ProviderID |
- |
Yes |
Provider ID for the node. A value is populated when the node is known. |
|||||||||
Labels |
- |
Yes |
Kubernetes labels of the resource. Can be used for defining custom dimensions. |
|||||||||
InvoiceYearMonth |
- |
Yes |
The month this usage was incurred. For example, 202305. |
|||||||||
InvoiceDate |
- |
Yes |
The day this usage was incurred. For example, 202305. |
|||||||||
StartTime |
- |
Yes |
The start date and time for this record. |
|||||||||
EndTime |
- |
Yes |
The end date and time for this record. |
|||||||||
CloudProvider |
Cloud Provider |
No |
Set to Kubecost. |
|||||||||
ChargeType |
Line Item Type |
No |
Set to Usage. |
|||||||||
UsageCategory |
Category |
No |
Set to Compute. |
|||||||||
Service |
Service |
No |
Set to Kubernetes. |
|||||||||
BillSource |
Bill Source |
No |
Set to Kubecost. |
|||||||||
Capability |
Capability |
No |
Set to csm. |
|||||||||
Manufacturer |
Manufacturer Name |
No |
Can be set as the CBI parameter. Default value is Kubecost. |
|||||||||
SpendType |
Spend Type |
No |
Set to Cloud. |
Ingested Kubernetes costs can be filtered and grouped by various usage types, including CPU cores, RAM bytes, GPU, persistent volume bytes, network transfer bytes, and more. The following table describes the usage metrics with their corresponding units.
Usage Unit |
Description |
cpuCoreHours |
Cumulative CPU core-hours allocated. |
gpuHours |
Cumulative GPU-hours allocated. |
networkTransferBytes |
Total bytes sent from the workload. |
pvByteHours |
Cumulative PersistentVolume byte-hours allocated. |
ramByteHours |
Cumulative RAM byte-hours allocated. |
Additional Tags for Kubernetes Costs
The Kubecost Flexera Exporter tool not only collects existing resource labels from Kubernetes but also generates additional tags to capture specific Kubernetes properties. The additional tags for Kubernetes costs are prefixed with kc- followed by the relevant property name. For example, the tag for the Kubernetes namespace is labeled as kc-namespace.
These additional tags are ingested alongside Kubernetes labels. You can use these tags to create Tag Dimensions, making Kubernetes cost analysis more intuitive.
The following table lists the additional tags and their corresponding Kubernetes properties.
Tag Key |
Kubernetes Property |
kc-pod-id |
Pod ID |
kc-container |
Container |
kc-node |
Node |
kc-controller |
Controller |
kc-cluster |
Cluster Name |
kc-namespace |
Namespace Name |
The following public repositories contain the source code and the image of the exporter.
• | Public GitHub Repository |
• | Public Image Registry |
Additionally, Kubecost savings recommendations for cluster rightsizing and container request rightsizing can be enabled via configuring the following automation policies:
• | Kubecost Request Rightsizing Recommendations—Recommends container resource reservation based on historical utilization and cost optimization. |
• | Kubecost Cluster Rightsizing Recommendations—Recommends Kubernetes cluster configuration for performance and cost optimization. |