Five ways to reduce Kubernetes costs

A magnifying glass held over a kubernetes logo on a computer screen
Kubernetes under magnifying glass (Image credit: Shutterstock)

Enterprises globally have been exploring ways to reduce Kubernetes costs over the last 18 months, as prices increase significantly for enterprise software.

Used efficiently, Kubernetes offers a range of benefits for enterprises: enhancing business productivity, streamlining application development, and reducing friction for developers to name a few. Price surges, however, mean Kubernetes could end up costing some businesses more than they bargained for.

Research from Civo in early 2023 showed almost half of all developers have witnessed a year-on-year increase in spending on Kubernetes clusters, with some contending with a spending surge of up to 25%.

Amid challenging economic times fraught with tightening budgets, this growing financial burden means some organizations are scrambling to reduce Kubernetes costs and optimize how they function.

Recent Kubernetes market analysis

The 2024 Kubernetes Benchmark Report, published by MSP Fairwinds, identifies several areas of concern in Kubernetes workload management, and these are the key areas where businesses should be cautious.

Many companies need to engage in something called “Container Rightsizing”, or making sure that the tools match the job. In fact, 37% of workloads are improperly sized, leading to inefficiencies in cost and resource use, according to the report.

There are also reliability issues, with Fairwinds finding that 65% of organizations don’t implement essential liveness and readiness probes, increasing the risk of downtime. And on top of this, 28% of workloads have unsecure capabilities enabled, exposing them to potential vulnerabilities, which makes doing all kinds of business riskier.

“This year, 67% of organizations have more than 11% of workloads impacted by missing CPU requests, down from 78% in 2023,” says the report. “Putting CPU request limits in place helps to increase reliability by guaranteeing the pod will have access to the resources needed.”

“Containers and Kubernetes can offer businesses significant benefits, but without understanding these essential configurations and how to set them appropriately, it can be difficult to navigate Kubernetes’ inherent complexities,” says Fairwinds.

How to cut the cost of Kubernetes

Effective monitoring

One of the first things you should consider before embarking on a cost-cutting campaign is to consider some of the key tools at your disposal to help monitor costs.

Research from 2021, for example, showed most businesses don’t monitor their costs, despite the fact prices were surging even back then.

A commonly-used tool among many enterprises is Kubecost. This particular tool analyses an organisation’s IT infrastructure environment to pinpoint areas of friction and poor performance, enabling you to target specific points within your environment to implement changes and cut costs.

Cluster management

Another thing to keep an eye on is clusters: the greater number of Kubernetes clusters your business uses, the more you will be required to pay for hosting costs.

This is because each cluster requires you to fork out for additional compute nodes to host your control plane in production, meaning you’re essentially multiplying costs within each cluster.

Dr Manzoor Mohammed, co-founder and CINO at Capacitas tells CloudPro that a recommended approach is to run fewer clusters, with larger worker nodes and small pods.

“Having small pods and large worker nodes, in a small number of clusters for the pods to run in, will allow you to pack the worker nodes more efficiently,” he says.

Running a single cluster to host all of your workloads is also recommended, enabling you to consolidate workloads and reduce financial burdens.

This isn’t a one-size-fits-all solution, however. There are instances where running multiple clusters is required, meaning each business should assess workloads and establish the ideal approach.

Utilize autoscaling

Autoscaling is among the most impactful ways that organisations can reduce Kubernetes costs, according to Tobi Knaup, CEO at D2iQ.

Configuring autoscaling enables you to add or remove nodes from Kubernetes clusters during off-peak times. This means that, depending on demand, workloads will still have consistent resources without the need for paying for excess infrastructure.

“It delivers benefits because it allows an application to scale to meet demand – when your usage spikes, autoscaling lets your app and your cluster scale up to meet that demand without degrading usage,” Knaup says.

“Some businesses, especially those with presence largely in a single country, can drive costs down by using autoscaling to scale down when their load is low.”

Understand your resource limits

Defining resource limits can be a highly efficient way to reduce Kubernetes costs, but there may be a compromise here.

By assigning a limit, it curtails the amount of memory or CPU resources that containers can consume. By doing so, you may prevent applications from burning through – or hogging – resources and incurring additional costs.

Combined with autoscaling, this provides a dual method for reducing costs by both setting a limit and preventing workloads from demanding additional resources to accommodate demand.

Be warned, however, that setting Kubernetes limits can present issues, according to Knaup. By setting limits there is the potential to inhibit workloads by cutting access to additional resources. This has been known to cause performance issues, which ultimately could negatively impact user experience (UX).

“The only downside to it is you have to carefully set the right resource limits such that it allows legitimate usage for an application,” he tells CloudPro. “Setting it too low would deny an application to function properly.”

Evaluate your providers carefully

Evaluating your provider options can be “essential” to reducing Kubernetes costs in the long run, Knaup suggests.

Assessing the pricing offered by providers, such as AWS or Azure, for example, will enable you to develop a deeper understanding of what fits best for your business and your budget. Most of the major providers offer tools to help estimate costs.

This isn’t just limited to costs, however. An equally important aspect to consider is what functionalities and features certain providers offer and whether they are cost-effective and relevant to your business needs.

Is reducing the cost of Kubernetes even possible?

There is no one-size-fits-all approach to help reduce Kubernetes costs, and the tactics employed by some businesses will vary compared to others.

Similarly, this differing approach is also dependent on the size of the organisation itself, with smaller businesses encountering far more acute issues with costs compared to larger enterprises.

Ross Kelly
News and Analysis Editor

Ross Kelly is ITPro's News & Analysis Editor, responsible for leading the brand's news output and in-depth reporting on the latest stories from across the business technology landscape. Ross was previously a Staff Writer, during which time he developed a keen interest in cyber security, business leadership, and emerging technologies.

He graduated from Edinburgh Napier University in 2016 with a BA (Hons) in Journalism, and joined ITPro in 2022 after four years working in technology conference research.

For news pitches, you can contact Ross at ross.kelly@futurenet.com, or on Twitter and LinkedIn.

With contributions from