Table Of Contents
Tracking Kubernetes Costs On An Hourly Basis Provides Crucial Context For Improvement Track What You Want, When You Want It With CloudZero

Your company may receive a monthly bill that includes the storage, network, and compute used to run Kubernetes applications. At this point, you can see how much you’ve spent on Kubernetes as a whole.

Even if you use a Kubernetes cost tracking service, you might only see rough estimates of your daily usage — likely based on averages — and no hourly data at all. This is better than your default cloud bill, without Kubernetes-specific metrics, but it lacks the granularity you need to be able to see meaningful changes early on.

While daily information is useful, it doesn’t go far enough to help companies identify areas that should be trimmed or optimized.

You may be able to look at your daily report and see if one deployment racked up a higher cost than another, for example, but you won’t be able to tell when that happened, how long it ran, or what you should do about it to bring your budget back under control.

Additionally, companies usually don’t evaluate in enough detail how their costs change over time.

The finance department will certainly notice when bills are higher than usual — and they may make their dissatisfaction known to the engineers — but perhaps that one incident was an outlier in the middle of an overall gradual dip in expenditure.

It could take several quarters or even years before small trends become noticeable. Without further context, there’s not much engineers can do with one month’s information.

If failing to quickly identify cost trends is the problem, the solution seems obvious: Start tracking costs over time in more detail. Let’s take a look at how tracking hourly costs over time will help you gain a clear picture of your Kubernetes usage and allow you to make changes as early as possible.

Tracking Kubernetes Costs On An Hourly Basis Provides Crucial Context For Improvement

Why aren’t one-time cost reports ideal?

Within Kubernetes, costs can fluctuate dramatically in the space of just a few minutes. Say you were to look at yesterday’s bill, you would see a list of serv ices and the costs each has amassed. This is essentially what you’re getting if you use a cost tracker that presents daily averages.

What you wouldn’t see, however, is how those costs change hour to hour.

A particular workload might look cost intensive in this singular snapshot, but if you placed it next to several more snapshots taken at other points throughout the day, you might find that it’s tiny in comparison to other deployments that were not running during the first period.

Or, you might see an intensive workload with proportionally high costs during this moment in time, but you would have no idea how that workload contributes to the month’s overall cost total. The workload might run constantly, churning through resources and racking up costs, or it may run once on that day and never reappear.

Looking only at daily costs means you’ll miss the fine, granular details about which deployments and workloads are actually contributing significantly to your costs. If you can’t break your total down into its detailed components, you can’t identify where some effort toward optimization would help lower your Kubernetes costs. In other words, by failing to pay attention to the finest details, you’d risk skewing the big picture.

If you extrapolate the same principle out to your monthly costs, you can understand why tracking only monthly costs falls short as well.

The trick is to measure your costs at the most granular level possible and then assemble your results into an overview that includes monthly or quarterly changes where drops and spikes become visible.

That way, you can view big picture changes over time and “zoom in” to see which costs contributed to unexpected cost spikes. Each snapshot becomes part of the larger whole.

Frequent cost tracking helps you identify trends quickly

Kubernetes costs tend to bounce around depending on the services being used during any given period.

Let’s say your cluster runs periodic tasks that start once every four hours or so. During this time, your machines are nearly at full capacity. The rest of the time, however, their computing power is sitting idle.

If a certain cluster’s costs fluctuate dramatically, it can be tough to notice a 3% improvement over the course of several months.

The improvement may be happening — or costs could be climbing higher — but the average looks roughly the same to human eyes until the baseline is different enough from its starting point that the change becomes noticeable. Outliers will draw extra attention and muddy the waters further.

By the time a trend emerges, you could have made any number of major decisions based on assumptions that didn’t take into account the fact that a shift was occurring. And let’s say there’s a problem that needs to be fixed. One particular service, for example, might be soaking up resources and racking up costs far too quickly.

Even if you made changes now, it would take a while before you saw the effects reflected in future Kubernetes bills. Perhaps your efforts fixed the issue and all is well; if not, you’re still stuck paying the exorbitant price until you can track down what’s happening and solve it.

When you track your costs on an hourly basis, rather than monthly or even daily, you can get an idea very quickly of how your optimization efforts affect your bottom line.

 If you make a certain change with the expectation that it will lower your costs, but it actually has no effect or even does the reverse, you’ll know it as soon as possible. Your hourly reports will show your cost trends moving in the wrong direction, and you can fix the error early rather than finding out on next month’s bill after the damage has already been done.

Why don’t more companies track Kubernetes costs over time?

If measuring costs over time is so powerful, why isn’t everyone doing it? As we mentioned earlier, the solution only seems simple on the surface. In reality, you would have a tough time breaking down your Kubernetes costs into any meaningful trends without a specialized platform like CloudZero.

The issue lies with the cost reporting system used by Kubernetes — or the lack thereof. If you take a look at your last bill and try to determine your hourly costs, you’ll quickly see the problem: Your costs aren’t broken down that way.

You could divide by the number of days in that month, but as we’ve covered, this rough daily average does nothing to tell you whether your costs have increased, decreased, bounced around, or stayed the same the whole time.

CloudZero is the only platform that allows for the level of fine-detail Kubernetes cost tracking you need to identify trends on the hourly level.

finops-automation-series-thumbnails

Track What You Want, When You Want It With CloudZero

While Kubernetes is notorious for its fluctuating nature and opacity regarding costs, the importance of tracking costs over time applies far beyond Kubernetes to all of your company’s cloud costs.

Whether your company is interested in gaining visibility into Kubernetes costs in particular or in optimizing cloud costs overall, CloudZero’s platform provides the tools and reports that will help you reach your goal.

Track each Kubernetes deployment and every cloud-related cost on an hourly basis, and then switch to the monthly report for a big-picture view. Or, customize your dashboard to display all quarterly cloud cost changes so you can keep a close eye on trends that take longer to materialize.

Regardless of which items and timelines you select, you can track the metrics that make sense for your business on the time scale of your choosing. to see CloudZero in action.