Optimize Kubernetes Cluster Costs With Resource Recommendations

Updated 1 month ago by Archana Singh

This is a Beta feature. Beta features are feature complete but might have some outstanding issues. 

Harness Continuous Efficiency (CE) provides recommendations for your Kubernetes clusters. These recommendations show you resource optimization opportunities to potentially reduce your monthly spend.

The recommendations are computed by analyzing the past utilization of CPU and memory of your workload. The implementation uses a decaying histogram of CPU and memory peaks weighted by recency.

Before using recommendations in your cluster environment, ensure that its impact is evaluated thoroughly. The person reviewing the recommendations should be able to understand the impacts identified in recommendations, as well as the impact on the infrastructure and business.

Using recommendations without proper assessment could result in unexpected changes, such as issues with system performance or poor reliability.

In this topic:

Before You Begin

Key Recommendation Concepts

This section defines different CE recommendation concepts.

Guaranteed QoS

In this Quality of Service (QoS) class, resource requests and limits are set exactly to the same values which guarantee that the resources requested by the container will be available to it when it gets scheduled. This is considered as the ideal QoS class for the most stable Kubernetes clusters.

For a pod to be given a QoS class of guaranteed:

  • Every container in the pod must have a memory limit and a memory request, and they must be the same.
  • Every container in the pod must have a CPU limit and a CPU request, and they must be the same.

For more information, see the QoS class of Guaranteed.

Burstable QoS

A pod is assigned to a QoS class of burstable if:

  • The pod does not meet the criteria for QoS class Guaranteed.
  • At least one container in the pod has a memory or CPU request.

In this QoS class, resources can go beyond requests up to the limits. This recommended action does not affect other workloads and stays within bounds of usage. The scheduler uses the request to place the pod on a node, but the pod can use more resources up to the limit before it’s killed or throttled. For more information, see the QoS class of Burstable.

Decaying Histogram

Histograms compute statistics about the distribution of values in a data set. The decaying histogram exponentially favors recent values over older ones, making it suitable for use cases such as monitoring the state of long-running processes.

Decaying happens in discrete time units called a half-life. Half-life is the time required for the weight of a sample to be halved. CE uses 1 day as half-life when computing recommendations.

How are Recommendations Computed?

In Harness CE, the recommendations are computed by analyzing the past utilization of CPU and memory of your workload. The implementation uses a decaying histogram of CPU and memory peaks weighted by recency. The recommendation categories are computed as the following:

  • For guaranteed recommendation, the resources are calculated at the 90th percentile of the CPU samples and memory peaks.
  • For burstable resources, lower and upper bound are based on 50th and 95th percentiles of CPU samples and memory peaks respectively. It also adds a confidence multiplier to provide tighter bounds with more data.

View Recommendations

You can view recommendations for your cluster from the Cost Explorer Overview and Cluster tab. Cost Explorer makes recommendations to optimize your resources to potentially reduce your monthly cloud cost.

Step: View Recommendations From the Overview Tab

The Overview page displays the top recommendations for your Kubernetes clusters. To view recommendations from the Overview tab, perform the following steps:

  1. In Continuous Efficiency, click Explorer.
  2. In Overview, click TOP RECOMMENDATIONS.
    Top Recommended Actions are listed. The list is sorted based on the highest potential savings.
  3. Click on the Recommended Action for which you want to see the details. Recommended Actions are displayed. You can toggle between the Guaranteed QoS and Burstable QoS views.

    In this example, the recommendation engine has analyzed 8 days of data. Based on the analysis the recommended actions are provided to optimize your guaranteed and burstable resources to potentially save $30.55 in the monthly bill.
  • Workload: Name of the workload for which the recommendation is provided. You can click on the workload to go to the workload details page.

  • Cluster: Name of the cluster where the workload is present for which the recommendation is provided.
  • Monthly potential savings: Amount that you can potentially save on your cloud cost.
  • Current Resources: Details of current CPU and memory utilization of your resources.
  • Recommended Resources: Provides recommendations for optimizing CPU and memory utilization of your resources. This will help in optimizing your cloud cost.
  1. Click <- arrow to go back to the Top Recommended Actions list.

You can use this information to optimize your resources to potentially reduce your monthly cloud costs.

Step: View Recommendations From the Cluster Tab

To view recommendations from the Cluster tab, perform the following steps:

  1. In Continuous Efficiency, click Explorer and then click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. In Group by, select Clusters to list all the clusters.
  4. Click on the cluster for which you want to analyze the cost and then select Group by Workload.
  5. Click on the workload for which you want to view the recommendations and click VIEW RECOMMENDATIONS.
    Recommended Actions are displayed. You can toggle between the Guaranteed QoS and Burstable QoS views.

    In this example, the recommendation engine has analyzed 9 days of data. Based on the analysis the recommended actions are provided to optimize your guaranteed and burstable resources to potentially save $15.57 in the monthly bill.
    • Workload: Name of the workload for which the recommendation is provided.
      For some of the workloads, you might see NA as monthly potential savings. It is displayed when there is no significant potential savings associated with this workload.
    • Cluster: Name of the cluster where the workload is present for which the recommendation is provided.
    • Monthly potential savings: Amount that you can potentially save on your cloud cost.
    • Current Resources: Details of current CPU and memory utilization of your resources. It also provides details of limits and requests set.
    • Recommended Resources: Provides recommendations for optimizing CPU and memory utilization of your resources.

    You can use this information to optimize your resources to potentially reduce your monthly cloud costs.


How did we do?