Member post originally published on the Fairwinds blog by Danielle Cook

Today, who isn’t looking for ways to minimize costs and increase efficiency? The uncertain economic environment is causing many organizations to take another look at cloud costs and consider how to make it more efficient. As cloud computing and cloud native technologies have enabled many to stay competitive in this business environment, many are moving production workloads to Kubernetes. How can teams better understand their cloud costs and learn how to manage them in Kubernetes without putting scalability and reliability at risk?

FinOps + Kubernetes

FinOps has already helped many teams identify unit costs as they relate to cloud spend, bringing engineering, finance, technology, and business teams together to make data-driven spending decisions. That alignment, coupled with greater ownership of cloud spend, has been beneficial, but moving to Kubernetes presents new challenges for FinOps teams, including: 

Kubernetes clusters are deployed on shared cloud instances, which means that it can be used to host multiple workloads and applications. While this is a cost-effective way to deploy and manage applications in the cloud, it can also make tracking spend difficult. The abstraction layer that Kubernetes introduces simplifies the management of containerized applications but also makes it harder to tie resource usage to actual cloud costs. For orgs that want to apply FinOps to Kubernetes, it’s essential to gain visibility into their costs by understanding how namespaces, workloads, and clusters are consuming the cloud. 

98% of stakeholders see operational benefits from Kubernetes, including improved resource utilization, shortened software development cycles, and increased efficiency of hybrid mode.

VMWare: The State of Kubernetes 2023 

1. Increase Cost Visibility

Many teams track costs by architectural scheme. This helps you organize Kubernetes resources into logical groups, which can be helpful in several ways, including managing resources, tracking costs by development team or business unit, and optimizing performance. 

To create an architectural scheme, you need to start by creating namespaces. This first step allows you to create further architectural concepts within that namespace.

Grouping resources in this way helps you understand your usage at scale. Using namespaces and labels, you can explore diverse ways to group resources to get the visibility you need for capacity and cost planning. You can group resources by namespace, by workload, and by clusters.

2. Track Cloud Spend

Once you set up your architectural schemes by creating namespaces and labels and use them to group your resources, you’re ready to start tracking your cloud spendOpen source tools, such asPrometheus, can help you track spend by namespace and label. Goldilocks is another tool that can help you ensure your workloads are configured with the right CPU and memory allocations. The groupings you created provide insight into how much each namespace, cluster, and workload is costing you. Ideally, you should also collect, store, and analyze your cost data. Cloud spend changes based on demand, so it’s helpful to gather enough data to analyze costs over time. 

82% of organizations, both enterprise and small businesses, find managing cloud spend their top cloud challenge. 

Flexera State of the Cloud Report 2023

3. Aggregate Usage & Cost Data

Once you begin to understand your cost and usage in Kubernetes, it’s time to optimize performance and attribute costs for applications, development teams, or shared workloads across clusters. Aggregated information can help individual teams adjust cloud usage to make it more efficient for their apps and services.  

As the data about your Kubernetes cloud costs begins to accumulate, you can review andanalyze your cloud usage monthly and quarterly to discover trends over time. Once you have twelve months of data, you’ll be able to identify sharp increases or decreases in application usage, which will help you do more capacity planning, cost forecasting, and cost optimization exercises. 

4. Analyze Build Cost 

Analyzing build costs is an important way for teams that are developing apps for others to make decisions about how much to charge. Understanding how much cloud resources are being used is also helpful for teams building apps and services for internal use. Using your architectural schemes, it’s a lot easier to track resources associated with specific builds or projects. It can also help you uncover resources that are no longer needed and identify overserved workloads

A cost attribution model can enable you to report costs back to the business units that incurred them. This can increase transparency into your costs and help you show finance teams where cloud spend is going in a visual and concrete way. It can also help you manage internal development teams as individual business entities with defined budgetary confines. Using a chargeback model, you can shift responsibility and encourage accountability for cloud spend in each team. 

Plan for Today & Tomorrow

Collecting and analyzing Kubernetes resource data can help you make long term inferences about how much hardware to reserve and request using real data on how your workloads have historically performed. In some cases, this may mean adjusting limits and increasing costs to improve reliability and performance. 

Fairwinds Insights monitors cloud spend costs and provides recommendations that can help teams increase efficiency of Kubernetes compute resources. It does this by providing a centralized view into Kubernetes costs that creates cost alignment across teams and eliminates Kubernetes cost waste. Insights collects, stores, and analyzes cloud spend and workload usage to help teams understand historical costs incurred across multiple clusters, aggregations, and custom time periods. If you want to see Insights cost capabilities yourself, check out the free tier or learn about the Team and Enterprise versions.

Kubernetes is complex, and it can be challenging to get started and use it efficiently and effectively. As you move apps and services to Kubernetes production environments, you need to know how to monitor your metrics and collect data. That information will enable you to do long term Kubernetes cost and capacity planning. 

Learn how to allocate and optimize Kubernetes cloud consumption — read the eBook: Understand Kubernetes Impact on Cloud Spend