CloudNatix logo

User Guide

Optimizing Kubernetes with Savings Plan Aware Rebalancing

Overview

On top of the Spot Rebalancing that CloudNatix offers, AWS Savings Plan users can further improve cost efficiency of their cloud infrastructure. By incorporating .CUR file information, CloudNatix can automatically rebalance spot and on-demand nodes in a cluster to maximize Savings Plan usage, ensuring minimal cost through the harmonious incorporation of various cost-saving methods.

Feature explanation

Let's look at an example scenario to explain this feature. Imagine a cluster with:

  • 1 On-demand node
  • 3 Spot nodes
  • An EC2 Instance Savings Plan with unused capacity for 2 nodes

A common pitfall of converting On-demand nodes to Spot instances is the lack of consideration for Savings Plan utilization. In this example, one On-demand node is kept for reliability, and the rest of the nodes in the cluster are converted to Spot instances to take advantage of the decreased cost. However, the overuse of Spot nodes in this case leads to missed savings by not maximizing Savings Plan usage. CloudNatix's Savings Plan Aware Rebalancing feature eliminates this issue by dynamically calculating Savings Plan usage and prioritizing Savings Plan-covered On-Demand nodes over Spot nodes. In the example above, CloudNatix would rebalance the nodes to:

  • 3 On-demand nodes
  • 1 Spot Node
  • An EC2 Instance Savings Plan with 100% utilization

In a scenario where the usage in the example cluster drops to 2 nodes, CloudNatix will right-size the cluster to use 2 On-demand nodes, allowing the Savings Plan to be used by other clusters in the account. As many clusters change in size, CloudNatix's Savings Plan Aware Rebalancer can dynamically maximize Savings Plan utilization while prioritizing Spot instances for usage above purchased Savings Plans.

Additional Use Cases for Savings Plan Aware Rebalancing

  • K8s usage pattern has changes since Savings Plan was purchased, leading to sub-optimal usage
  • Savings Plan was purchased to cover more than the minimal usage, leading to increased complexity in Spot conversion
  • Many clusters using the same Savings Plans, leading to confusion on what instance types to prioritize

In all of these cases, using CloudNatix's Savings Plan Aware Rebalancer eliminates the issues and leads to increased savings.

Requirements

  • Karpenter is installed
  • Billing data is registered with CloudNatix

Limitations

CloudNatix's Savings Plan Aware Rebalancer is currently only available for AWS environments

Enabling Savings Plan Aware Rebalancer

The Savings Plan Aware Rebalancer feature is not enabled by default. To enable the feature take the following steps:

  1. Provide access to an S3 bucket containing your AWS CUR files
  2. Upgrade CCOperator to the latest version.
  3. Specify Commitment Agent related parameters in values.yaml
  4. Ensure cluster-rightscaler-agent is in the list of Cluster Controller components that are installed in a cluster.

To provide access to your CUR files, please contact a member of CloudNatix staff at support@cloudnatix.com or on Slack, and we can start this process together.

After enabling access to AWS CUR files, first pull the latest Helm chart (v0.792.0 or later).

helm repo add cloudnatix https://charts.cloudnatix.com
helm repo update
helm pull cloudnatix/ccoperator

Then set the CCOperator version and Commitment Agent parameters in values.yaml:

clusterRightscalerAgent:
  commitmentAgent:
    enable: true
    defaultNodePoolName: <nodepool-name>

defaultNodePoolName serves as the NodePool that CloudNatix should spawn more nodes from when Savings Plan utilization is at 100%

Lastly, ensure that cluster-rightscaler-agent is in the list of Cluster Controller components. Here is an example of how to do that:

cnatix clusters components create \
  --cluster <cluster-name> \
  --kind cluster-rightscaler-agent \
  --version <agent-version> (--upgradable)

Now CloudNatix will begin to understand your Savings Plan utilization and rebalance Spot instances incorporating your unique discounts.

This feature is built on top of CloudNatix's Spot optimization

Spot rebalancing

Previous
Optimizing Kubernetes with Spot Rebalancing
Next
Upgrading Kubernetes Clusters with CloudNatix automation