As more enterprises adopt Kubernetes as their container orchestration platform of choice, the topic of Kubernetes optimization is coming up more and more. With the complexity of Kubernetes resource management, manual approaches to optimization can require days or weeks of tuning, tweaking, and troubleshooting.

This blog will provide an overview of Kubernetes optimization – what is it, why does it matter, and how can you achieve it?

What is Kubernetes Optimization?

To start, let’s be sure and define what we mean by Kubernetes optimization. Merriam-Webster defines ‘optimization’ as:

an act, process, or methodology of making something (such as a design, system, or decision) as fully perfect, functional, or effective as possible

If we apply that to Kubernetes, it means we want to make our cloud native/Kubernetes environment and the applications that run in that environment as perfect, functional, or effective as possible. The term “perfect, functional, or effective” may mean different things to different organizations, but leaving aside an application’s functional requirements, Kubernetes optimization consists of two key components:

  • An application’s performance and reliability. In other words, what is the response time of the application and how much downtime does it have?
  • The cost of running the application, which is a direct result of compute resources utilized in running the app, for example CPU, memory, and storage.

Simply put then, Kubernetes optimization means that your application meets or exceeds business requirements for performance and reliability (defined by SLAs and SLOs) at the lowest possible resource utilization and cost.

How Kubernetes Optimization plays a role in Cloud Environment Efficiency

Kubernetes adoption continues to accelerate, with recent data from Red Hat1 showing 88% of organizations using the popular container orchestration platform, with 74% of those using it in production. However, only 16% are using Kubernetes as the exclusive platform for running their apps, according to a 2021 survey by Canonical2.

This is curious, because enterprises have high expectations from Kubernetes. In their 2021 Kubernetes Adoption Survey3, Portworx found that the top three reasons for Kubernetes adoption are:

  • Accelerating deployment frequency (59% of respondents)
  • Increasing automation (54%) 
  • Reducing IT costs (46%)

These benefits all bring tremendous business value. One reason organizations have been slow to standardize on Kubernetes is the perceived difficulty of Kubernetes optimization. In the Canonical survey, respondents were asked, “What are the TWO most important questions that ops people should care about?” Not surprisingly, security was the number one response. The next three top responses ALL related to Kubernetes optimization and resource allocation.

Graph displaying data for Canonical Kubernetes and Cloud Operations survey results on "What are the two most important questions that ops people should care about?"
Data source: Canonical Kubernetes and Cloud Native Operations Report 2021

Get Started with StormForge

Try StormForge for FREE, and start optimizing your Kubernetes environment now.

Start Trial

Benefits of Kubernetes Optimization

It’s clear that Kubernetes optimization is a priority for enterprises, for several reasons:

  • Cost savings – With cloud costs making up an increasing portion of the overall cost of revenues, sometimes approaching 75-80%4, and 48% of cloud spend wasted, Kubernetes optimization is imperative, and the opportunity for cost savings is substantial.
  • User satisfaction – Kubernetes optimization means consistently meeting or exceeding SLAs and SLOs. The result? No more unacceptable response times or frustrated users, and fewer abandoned site visits. 
  • Efficient resource utilization – While cost savings is important, resource utilization is another benefit that should be considered separately. Especially for organizations running on-premises in private clouds, compute resources can be reallocated for other uses, like additional testing environments.
  • Environmental responsibility – Kubernetes efficiency means fewer resources used, with the result being reduced carbon emissions from data centers. And while environmental responsibility is worthy on its own merits, it’s also valued by consumers, with 92% more likely to trust a company5 that supports social or environmental issues.

How to achieve Kubernetes Optimization

Given all the benefits, why is Kubernetes optimization still a top unsolved issue for so many organizations? It’s because the perception is that optimization is time-consuming and difficult. As one developer commented, “Who has time to optimize? The name of the game is to slap as many features together as possible as fast as possible and ship it!”

It’s true that time spent doing anything other than developing new and differentiating capabilities is considered by most organizations as time wasted. With the complexity of Kubernetes resource management, manual approaches to optimization can require days or weeks of tuning, tweaking, and troubleshooting. Nothing could be more frustrating for an engineer who just wants to work on cool technology and deliver business value.

Fortunately, new solutions like StormForge have applied machine learning and automation to make Kubernetes optimization virtually effortless. StormForge works by using a fully automated process of rapid experimentation to try out different resource settings before deploying an application to production. While this might require millions of trials for a human to effectively find the optimal settings, StormForge’s patent-pending machine learning algorithm can find the optimal configuration in a fraction of the time, and with no intervention from developers.

With tools like StormForge, Kubernetes optimization can become more than an unattainable vision. In fact, given the value that can be gained with minimal effort, it’s now a must-have.

To see how StormForge can help, register here to take a test drive for free.

FAQ

Getting an application’s performance optimized is important for several reasons. First, it means that the application will operate as users expect – in terms of availability, reliability, speed, responsiveness, etc. The second reason is financial. Over-provisioning cloud apps is one way to help ensure that they run well, but doing so can drive costs through the roof. Properly optimized applications perform well under load, but do so in a cost-effective way with ‘just right’ provisioning.

There are two ways to optimize a Kubernetes environment:

  1. Handle the task manually. This involves a human manually changing settings or parameters, assessing how these “tweaks” have impacted results, and then employing a trial-and-error process until one set of results are acceptable and desirable. Clearly, this trial-and-error approach is time-consuming, error-prone and ultimately ineffective for optimizing a Kubernetes environment.
  2. The alternative is automated optimization of resource management and application performance that is software-defined – driven by artificial intelligence and machine learning. Given the huge numbers of variables involved with cloud-based applications, and the complexity of testing, adjusting and re-testing millions of combinations of variables, the automated approach is far superior to any manually-based efforts.

Container optimization is the process of finding the set of configuration options that will result in application performance that meets or exceeds SLAs at the lowest possible cost. Configuration settings include CPU and memory requests and limits, replicas, and application-specific settings such as JVM heap size and garbage collection. Container optimization is important because each of these settings has an impact on an application’s performance and the resources used to run it.

Kubernetes clusters include one or more nodes that run containerized applications. Within this set of components, there are several opportunities for improvement in terms of performance and efficiency, including:

  • Resource optimization at the container level, including memory and CPU requests and limits, and replicas.
  • Resource and configuration settings for the applications inside the container, including worker process/thread counts, garbage collection settings, memory process allocation, and cache settings.
  • Resource settings and constraints at the node level, including CPU and memory available for scheduling workloads as well as restrictions and affinities on what type of workloads can be scheduled on the node.
  • Also for nodes, specialized hardware such as GPUs can be added to assist with specialized workloads.
  • Networking and storage infrastructure can be balanced between performance, cost, and level of complexity.


References

[1] Red Hat, State of Kubernetes Security Report

[2] Canonical, Kubernetes and Cloud Native Operations Report 2021

[3] Portworx, 2021 Kubernetes Adoption Survey

[4] Andreeseen Horowitz, The Cost of Cloud, a Trillion Dollar Paradox

[5] Forbes, Do Customers Really Care About Your Environmental Impact