For the latest version of this help, see: https://help.apptio.com/en-us/cloudability/product/k8s-cost-allocation.htm
You can integrate Kubernetes (k8s) container data into Cloudability to gain visibility into the portion of your cloud spend due to container costs, and to assure it’s appropriately allocated.
View Kubernetes cost and usage data
You can view Kubernetes data on the Containers page or throughout Cloudability in tools such as Reports, TrueCost Explorer, and Tag Explorer.
- For a holistic view of your Kubernetes cost and utilization data together, use the Containers page.
- For investigating your Kubernetes costs in relation to your total cloud spend, use Reports, TrueCost Explorer, and Tag Explorer.
Analyze Kubernetes data using reports and other tools
Create a report including your k8s labels
K8s costs can be viewed alongside other cloud costs in a single report. Using k8s labels and business mappings, you can combine off-cluster costs (e.g. load balancers, DBs, etc.) with k8s container costs in a single report.
To see each dimension appear as a line item in your report (subject to filtering), select that dimension as a cost dimension. Note that there will also be a (not set) line item for the dimension that represents the costs incurred when the Pod or Deployment (or other k8s structure) did not set a value for the k8s label mapped into the dimension.
NOTE: There will be no separate IDLE RESOURCES value for a dimension. IDLE RESOURCES are maintained at the cluster level in a construct that appears in the list of namespaces. If you want to see the dimension's fair share of a cluster's idle resource cost, you must add the Namespace dimension to the report.
We are delivering two new built-in dimensions for cost reports:
- Cluster Name
You can use these dimensions to build new cost reports or enhance existing cost reports.
Use the Cluster Name dimension
To see each k8s cluster name appear as a line item in your report (subject to filtering), select Cluster Name as a cost dimension. The Cost (Total) metric represents the entire cost attributed to that k8s cluster, including idle resources, utilized and idle costs of the underlying compute nodes, and on AWS, EBS storage volumes. Note that there will also be a (not set) value for Cluster Name that represents all the costs within the account that are not part of any k8s cluster.
Use the Namespace dimension
To see each unique namespace appear as a line item in your report (subject to filtering), select Namespace as a cost dimension. The Cost (Total) metric represents the k8s costs attributed to that namespace, specifically the utilized costs of the underlying compute nodes.
- Not all cluster costs are attributed to a specific namespace within a cost report. For example, in AWS deployments, EBS costs of attached volumes are instead considered a cluster cost and therefore shown with a (not set) value for Namespace. The same is true for Storage resources in Azure.
- When you include Namespace as a dimension in a report, costs representing the allocated but unused resources within a k8s cluster appear as a separate line item labeled IDLE RESOURCES.
- When you add other dimensions to a report, such as Usage Family or Service Name, you will see additional cost details around each cluster name or namespace (subject to filtering).
To see only resources and costs associated with a specific namespace or cluster name, use the built-in filter function.
Define additional dimensions based on K8s labels
Many organizations utilize labels in their k8s deployments in a similar way that they leverage resource tags within their cloud environments. To see these label key/value pairs appear within your Cloudability environment, you can map these label keys into dimensions in the same way that resource tags are mapped. Using the Tag & Label Mapping page, you can define new dimensions (and edit existing ones) and assign either resource tags or k8s labels to each dimension.
If you choose to map both k8s labels and resource tags into the same dimension, there are a couple key items to note.
- K8s labels should only be mapped into dimensions with resource tags when the values of both the labels and tags are homogenous. Just as mapping unrelated resource tags into the same dimension can cause confusion, mapping unrelated labels and resource tags into the same dimension will only compound that confusion.
- In the event a resource tag and k8s label (both mapped to the same dimension) differ in value, the value from the k8s label will be selected and used, and the resource tag value dropped.
You are able to map up to 10 unique k8s labels keys within the Tag & Label Mapping page. Keep in mind that when you add or edit these mappings, you will start to see the values in reporting the next time we ingest a new vendor billing file. We will update this historically for the current month.
Use the Tag Explorer
Just as with any other business mapping, mappings that you define using container-specific dimensions can be used in the Tag Explorer. This can help in understanding the costs associated with your k8s clusters and namespaces.
Use the TrueCost Explorer
Just as with any other business mapping, mappings that you define using container-specific dimensions can be used in the TrueCost Explorer. This can help in understanding how costs flow through your k8s clusters and namespaces.
Create business mappings
You can create a new business mapping (or edit an existing one) and use container-specific dimensions. The inclusion of these dimensions into a mapping is a powerful tool that enables you to combine different costs into a single construct. You can bring together k8s cluster costs with other, off-cluster costs to build a holistic view of your overall k8s computing costs.
You can create a new view (or edit an existing one) and use a mapping built from container-specific dimensions. Note that on the Containers page, the use of views based on business mappings are not supported, regardless of whether container-specific dimensions are used in the view definition.
Just as with other dimensions mapped from resource tags, you can use dimensions with k8s labels in Business Mappings, Views, TrueCost Explorer, Tag Explorer, and Reports.
NOTE: When you compare cost allocation between the Containers page and a report, you may see differences. While cost at the k8s cluster level will be very similar (within a fraction of a percent), costs allocated to individual namespaces may differ.
On AWS accounts, EBS costs are handled differently. On the Containers page, EBS costs are allocated across each namespace based on their proportion of resource usage. In a report, however, these EBS costs are bundled together and left with the cluster. Therefore, you will see a (not set) bucket of EBS costs with the k8s cluster. The same is true for any non-node resources on Azure. In the near future we will allocate all cluster resources based on their usage.