4 Ways to Curb Kubernetes Cloud Costs

According to a recent survey by the FinOps foundation, a program in the Linux Foundation dedicated to advancing the discipline of cloud financial management, best practices and standards, Kubernetes-related cloud bills are going up.

As the adoption of Kubernetes is growing across the board, the increase in costs is expected and shouldn’t be surprising. However, it’s key to understand the difference between spending and the waste of significant cloud costs that could be monitored, measured and controlled.

Many CIOs and IT leaders adopted Kubernetes, the de facto standard for managing application containers at scale, hoping to reduce time-to-market, lower infrastructure costs and improve the scalability and availability of their enterprise applications. 

Now, however, for many organizations, Kubernetes is turning into a cost concern for CFOs and giving IT leaders pause as they analyze the costs and benefits. Such concerns are leading some organizations to slow the adoption of Kubernetes and repatriate workloads to private clouds.

There are four areas to consider that can help curb Kubernetes cloud spending: cloud, cluster, core tooling and culture. While some of these ideas also could apply to on-premises Kubernetes, the focus here is on managed or hosted solutions on public cloud providers.

Cloud

Around the end of each organization’s fiscal year, business leaders gather to set strategies and allocate budgets for the upcoming year. There are pre-allocated monies for the different functions and operations within the organization including IT, of course, but it’s advisable to go one step further within the IT budget and specifically differentiate a cloud budget. Some organizations are even able to forecast their cloud usage and allocate the budget accordingly.

Having a specified cloud budget is beneficial for two reasons. First, you’re setting a threshold that you can decide to go above or below by a certain amount as needed. Second, you’re able to take action when things start getting out of control.

One way to help control costs is to make sure to take advantage of discounts to reduce your overall cloud spending regardless of Kubernetes use. For example, you can dramatically reduce your AWS costs by using spot instances as well as reserved instances, in some cases.

The good news is that all major cloud providers allow for setting budgets to monitor, measure and control your cloud costs. Also, you should be able to generate reports to easily view,  analyze and communicate your cloud spending across the organization. 

Cluster

In terms of Kubernetes clusters, there are many cost control measures you can take. One strategy is unit cost allocation. Recently, Google’s Kubernetes Engine (GKE) started pod-based pricing that’s part of its new Autopilot offering, for example. 

A similar approach is to allocate costs per namespace or by a group of workloads. While the resources might vary for each team and/or application, you can use “t-shirt sizing” to provide options for the consumers of the platform depending on the amount of compute, storage and networking resources needed.

Another common strategy is chargeback. By taking measures up front, you should be able to link objects used (pods, namespaces, etc.) to a particular business unit or a line of business that consumed those resources and bill them accordingly.

A slightly different version of this strategy is showback. It’s exactly the same process as chargeback except that there’s no billing; it’s mainly used to demonstrate transparency and improve visibility into spending across the organization.

Each approach has its pros and cons and requires time, effort and buy-in across the organization. Many organizations being by simply monitoring usage and gradually moving on to unit cost allocation, then showback and then chargeback.  

Core Tooling

If you can’t measure it, you can’t improve it. It goes without saying that you should be consistently monitoring your usage and costs. Monitoring makes it easier to visualize, understand and eventually manage your cloud costs. First, you want to get a clear picture of your cloud spending to be able to identify areas of improvement. After you have implemented monitoring and then identified where spend is occuring, it is easier to deploy measures to control and eventually reduce your cloud spending.

All major cloud providers have native tools to help with that: AWS Cost Explorer, Microsoft Azure Billing and GCP Billing. For Kubernetes, there are a plethora of open source and commercial tools to help you monitor, measure, and control costs.  

Kubecost, for instance, is an open source tool that gives teams visibility into current and historical Kubernetes spending and resource allocation. And there are many proprietary tools from vendors that provide cost transparency, optimization and governance functionality across the major cloud providers for Kubernetes and beyond.  

kubernetes cloud costs

Courtesy of Kubecost

Culture 

The State of FinOps Report 2021 summarizes the challenges FinOps teams face when it comes to cloud costs management. The ultimate challenge is getting engineers to take action.

Engineers should have skin in the game and be actively engaged in cost-cutting initiatives. Otherwise, they will continue to build and deploy applications with little or no attention to costs. IT leaders should strive to build a culture that engages engineers in various initiatives inside the organization and cost-cutting initiatives are no exception. This could be done by providing financial as well as non-financial incentives.

For example, one financial services organization increased a team’s bonus pool for every thousand dollars saved in cloud costs. Another organization offered to donate a percentage of the money saved to a charity of the engineers’ choice and gave them extra paid time off. By doing so, IT leaders send a clear message that reducing cloud costs is for everyone’s benefit—not just shareholders and executives.  

By paying attention to cloud, cluster, core tooling and culture, you should be able to curb Kubernetes cloud spending while continuing to reap the benefits of the technology. Cloud costs are going to continue to rise; what matters most is what you’re going to do to reduce waste and control those costs. 

Mostafa Radwan

Mostafa Radwan is a consultant who specializes in cloud and cloud-native computing. He started his career as a software engineer before getting in the trenches doing application and production support. He enjoys partnering with CIOs and IT leaders to adopt DevOps and cloud-native technologies and drive better business outcomes. When not serving clients or tinkering with technology, Mostafa likes to read, bike, and travel the world with his family. He can be reached at [email protected]

Mostafa Radwan has 3 posts and counting. See all posts by Mostafa Radwan