I was speaking with a VP of Engineering friend at last year’s KubeCon about how to pitch Kubernetes to the C-Suite. The benefits for innovation were clear - containerized microservices empowered her small teams to deliver more value, more rapidly. As is often the case with Boardroom discussions, though, the question of cost was always next. Sure, they want you to innovate - as long as it’s within the constraints of a budget! But cost discussions around Kubernetes can be difficult. You have disposable and replaceable compute resources constantly coming and going, on a range of types of infrastructure. Yet at the end of the month, you just get a billing line item for EKS and a bunch of EC2 instances. When you try and do a Kubernetes cost analysis, the bill doesn’t have any context about the workloads being orchestrated - and it certainly doesn’t align the spend to business contexts like cost per tenant. So when the CFO asks how much it really costs to run this or that feature in Kubernetes, how would you do it?
Today, you most likely use namespaces and pod names to identify the various workloads being orchestrated. You get a monthly EKS and EC2 bill from AWS. Then, simply gather the cost data and assign usage of an EC2 instance based on fractional utilization of its compute and memory resources. Don’t forget all the other factors with significant price impact – SSDs, for example, or enhanced networking. These will have correlations with compute and memory that bias cost as well. And you’ll need actual runtime utilization information. In each of the 730 hours in the month, which pod was running where with how much resource allocated to it, and how much was actually utilized vs just allocated? Drop that all into a spreadsheet and off you go. Next thing you know, it’s 1am, you’ve had three espressos and 2 Kilchomans neat, and you still can’t say whether the search feature cost you thirteen or thirty thousand last month.
I’m happy to announce that as of today, you can skip the espresso, enjoy the whisky, and get to bed at a decent hour. CloudZero now offers an incredibly simple way to do a kubernetes cost analysis and view detailed breakdowns of real cost by cluster, namespace, or pod down to the hour. And those costs can be understood in the context of what’s important to your business; by product and feature or by team and business unit, for example.Are there unexpectedly high costs for a given feature? Alert the team responsible for it in their own Slack channel. Want to see the impact that a given release from your CI/CD pipeline had on COGS for a product? We can do that, too.
This solution comes as a result of a great partnership between CloudZero and multiple AWS teams. As an AWS Partner Network (APN) Partner, we were able to work with the AWS SaaS Factory program who provided a targeted combination of SaaS content, tooling, and embedded resources to accelerate the project. AWS SaaS Factory enabled us to work directly with the AWS CloudWatch Container Insights team to power the container metrics used in the solution. This level of support from AWS has helped us deliver an innovative solution to this tricky Kubernetes cost problem. As a result, CloudZero customers innovate faster within the constraints of cost - an important strategic advantage, particularly in these challenging times.
How does it work? In brief, we bring container utilization data, AWS cost data, and information about your business context all together in the CloudZero platform and apply our own proprietary algorithms to accurately and automatically allocate costs within your Kubernetes clusters. There are no manual rules for you to create, just configure the data ingestion and sit back - perhaps while enjoying a nice espresso - and the CloudZero platform does the rest.
For runtime insight about your containerized workloads, what better source than the platform where those workloads are running? AWS CloudWatch Container Insights is a service that does the kubernetes cost analysis for you by collecting, aggregating, and summarizing metrics and logs from your containerized applications and microservices. It discovers all of the running containers in a cluster and collects performance and operational data which you can view on dashboards or use with CloudWatch alarms. CloudZero ingests a small amount of Container Insights data, which is generated by the CloudWatch Agent, to power the container cost allocation feature. If you’re using (or would like to use) the full Container Insights service, great - all you need to do is set the permissions for the CloudZero platform to read the CloudWatch data. But if you don’t want to use the full Container Insights service, a custom configuration is available that will only log the information needed for the cost allocation capability.
CloudZero combines the metrics from the AWS Container Insights service with AWS billing information to automatically allocate costs to the workloads being orchestrated by Kubernetes. We calculate the cost of each pod within the architecture, and then re-aggregate them to attribute costs to other hierarchical Kubernetes concepts, like namespaces and clusters.
Cost is calculated based on the cost of the EC2 instance - which represents the cost of a node in the Kubernetes system - combined with pod-level CPU and memory utilization. This allows us to assign a portion of the node’s total cost to the pod. This is handled automatically in the CloudZero platform; there is no need for manual allocation rules.
Generally speaking, this proportional algorithm works across a broad range of EC2 instance types, including those with SSD, NVMe SSD, GPU cores, GPU memory, and networking enhancements.
At that point, you can understand the cost of each individual containerized workload just like you would any other non-containerized resource - or, as is often the case, along with related non-containerized resources like storage or networking to get a complete understanding of your software’s COGS. And you can bring that understanding to the individual engineering teams responsible for each component of your solution so they can make better decisions that impact your business’s bottom line. And you can do it all without crazy spreadsheets or a dedicated financial analyst to help.
Below: CloudZero helps you understand the cost of your product features and the services that make them up. View both granular and high level costs - and everything in between.
Learn More About CloudZero
CloudZero is the first real-time cloud cost platform designed specifically for engineering and DevOps teams.