Kubernetes workload chargeback and showback - Spot.io

Kubernetes workload chargeback and showback

Reading Time: 3 minutes

 

Cloud cost allocation is an established FinOps practice within modern organizations, with many available tools for showback and chargeback. However, it has been limited to resources that can be neatly mapped to specific business units based on tags, cloud accounts and the like. This is particularly true within Kubernetes clusters,  where gaining any level of visibility into the resources that different business units, teams or projects are consuming, is much more difficult. In this post we will cover how cost allocation for Kubernetes workloads can be achieved with ease and accuracy.

Kubernetes is efficient yet complex

While Kubernetes delivers greater efficiency by allowing the underlying compute infrastructure to be shared by multiple pods or applications belonging to different teams and business units, this very aspect is what creates so much difficulty when it comes to cost allocation. Despite the fact that you can label or annotate Kubernetes objects, the process of accessing and analyzing the proportion of CPU, memory and storage consumed by the various projects, teams and business units, is not at all simple. Of course, without that information, it’s impossible to accurately associate node and storage costs with Kubernetes workloads.  

Although tools like Grafana, and solutions based on it, can be used for collecting and presenting cluster cost analysis and showback, this requires quite a bit of set-up and ongoing maintenance. 

To address the growing demand for highly accurate, container-level cost showback and chargeback, we are pleased to announce that Ocean by Spot, our serverless container solution, now provides advanced cost analysis for managed Kubernetes such as EKS, GKE, AKS, and self-managed Kubernetes such as Kops, Kubeadm or DIY containerized workloads.  

Kubernetes cost analysis made simple

As the leading solution for simplifying container infrastructure management, increasing workload availability and lowering compute costs, Ocean by Spot is already managing over 5 million containers for our customers. In this capacity we have access to the exact breakdown of node usage by Pods and other K8s resources, which we now can leverage to help our customers visualize K8s usage and associated cost, in the following ways:

Cost allocation by Namespace

With namespaces being used to create logical groupings within a cluster, this is a very straightforward way to identify which environment, team or other grouping is responsible for the associated cost. This cost analysis option will show you both the aggregated spend per namespace as well as a breakdown of spend by deployments and other K8s objects within that namespace.

Kubernetes Showback by Namespace

Cost allocation by Namespace Label

This cost analysis option shows a spend breakdown of namespaces that have been given a specific label. For example, if namespace1 and namespace2 are labeled with the key “environment” and the value “production”,  while namespace3 and namespace4 are labeled with “environment” and value “dev”, you will see an aggregation by the different values, i.e. all the resource costs from namespace1 and namespace2 under “production” and all resource costs from namespace3 and namespace4 under “dev”Within each environment, you will also see the cost breakdown by any relevant K8s objects such as deployments, replica sets, etc.

Cost allocation by Resource Label

This cost analysis option shows a spend breakdown of resources that have been given a label. For example, if a group of resources are labeled with the key “App”, you will be able to see all the values, e.g. all the different apps and their associated spend. Within each app, you will see the cost breakdown by any relevant K8s objects such as deployments, replica sets, etc.

Kubernetes Chargeback by Labeled Resources

Cost allocation by Annotation 

In the exact same way that Spot Ocean provides cost analysis for groups and namespaces that have been labeled, it does so for resources and namespaces that have been annotated.

Filtering based on Labels and Annotations

If you wish to only look at a subset of your cluster, either based on labels or annotations, our filter will allow you to do just that. For example, if you wish to view only the costs incurred by your K8s application manager, Helm, select the relevant type (label/annotation), the key, an operator (e.g. equals, exists, etc.) and the desired key value. 

Kubernetes Cost Analysis Filter

Sounds interesting? Learn more here!
Automate and optimize Kubernetes infrastructure with Ocean. Find out more.