How to Unite AWS Reserved Instances with Karpenter to Ensure Optimal Savings
Partner Success Team Lead
Both Karpenter and AWS Reserved Instances (RIs) were built to reduce the overall On-Demand costs of cloud resources. However, when they are not synchronized properly, Karpenter can potentially undo the savings benefits of Reserved Instances.
Reserved Instances are discounted pre-paid cloud computing capacity offered by AWS which are used to bring down the cost and provide pricing stability for On-Demand instances – the premium pricing model. Karpenter is a Kubernetes cluster auto-scaler that automatically launches just the right compute resources (e.g CPU, memory) to handle a cluster’s applications.
Unfortunately, using Karpenter to rightsize workload resources when they’ve been allocated for Reserved Instances can reduce the steady-state workloads that are already benefiting from discounts. Since Karpenter’s default configuration chooses diversified EC2 instances, this can result in significant over-provisioning, as well as a potential spike in On-Demand costs.
This article describes how to use Reserved Instances and Karpenter in harmony and optimize your savings and resources at the same time.
Using RIs and Karpenter in the Wild
To understand the ramifications of using Karpenter on top of Reserved Instances without taking necessary precautions, let’s dive into an actual use case.
A company in the SaaS industry implemented EKS and Karpenter in its default configurations. By default, Karpenter is being trained for one week to find the most efficient workload types and configurations for the customer’s particular environment and rightsizes the nodes accordingly. This consolidation process can potentially reduce the number of nodes in the environment.
This meant that when the customer moved container workloads into Karpenter, the total number of nodes dropped, leading to significant over-provisioning of existing RIs and a spike in On-Demand costs.
In order to reverse the spike in On-Demand and achieve the best utilization of RIs, the SaaS company needed to consider the following:
- Which instances Karpenter was deploying
- How Karpenter was configured
- The minimum base to which workloads could be dropped
By answering these questions, the company could configure Karpenter to better align with RI allocations and maximize discounts.
Unpacking the Impact of Karpenter’s Technology
As we saw in this example, while Karpenter reduces infrastructure costs by rightsizing nodes, it has the potential to backfire financially when used with steady-state workloads that have already been allocated to RIs.
This can result in the following short-term implications:
- Karpenter’s ability to rightsize workloads to improve efficiency and reduce costs may wind up doing the complete opposite.
- ‘Steady-state’ workloads that are safely covered with RIs may completely disappear once Karpenter is rolled-out within specific regions and family types. This could lead to massive over-provisioning and increased costs.
- Workloads may dramatically increase in new/existing regions and family types unexpectedly leading to a spike in a customer’s On-Demand costs.
By strategically allocating workloads to Karpenter and optimizing the use of Reserved Instances, the customer could enhance their ability to leverage discounts from both technologies, resulting in maximum cost savings.
Reconfiguring Karpenter for Improved Workload Stability
Reconfiguring Karpenter to change the instance family type is another way organizations can ensure workload stability and achieve the best cost optimization results with both RIs and Karpenter.
By configuring Karpenter to use only a specific instance family type, you can ensure that steady-state workloads which are allocated for RIs are not impacted by Karpenter’s rightsizing capabilities and cause the RIs to be over-provisioned.
Here’s a suggested configuration to limit the Karpenter choice of instance families to m5:
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
name: m5-instance-family
spec:
# References cloud provider-specific custom resource, see your cloud provider specific documentation
providerRef:
name: default
requirements:
- key: "karpenter.k8s.aws/instance-family
operator: In
values: ["m5"]
# Priority given to this provisioner. Higher weights indicate higher priority.
weight: 100
Manage Your RIs with Zesty
While it’s certainly possible to manage RIs and Karpenter on your own, it’s a difficult balancing act that takes a lot of time, effort, and strategic planning.
All of this can be made easier by using Zesty to manage your RIs and enable them to complement Karpenter. This way, you’ll have a dedicated Customer Success Manager to ensure all of the strategic planning and allocations are done properly in advance, maximizing your cloud savings and keeping you ahead of the game.
The benefit of this strategy can be seen in the following example:
As you can see in the graph above, a customer experienced a sudden decrease in workload volume once Karpenter was deployed and started to reconcile the number of nodes, (this is indicated by the volume in blue). Zesty’s Commitment Manager, immediately detected this drop in workload volume and reduced the allocation of Reserved Instances on the account (this is indicated by the volume in pink). Without requiring any human effort, the environment remained cost-efficient as Reserved Instances were automatically taken off the account when they were no longer needed.
For those looking to have Zesty manage their RIs or already have Zesty managing them, it is important to make your support person aware of Nodes that are also managed by Karpenter. With this information, we are better equipped to work together to eliminate risks and provide you with the best savings possible.
For more information on optimizing savings with Zesty and Karpenter, please contact Zesty and one of our cloud experts will reach out to you.
Related Articles
-
5 Major Announcements From AWS re:Invent
December 23, 2024 -
A Holiday Tail: The DevOps Engineer Who Saved Christmas
December 19, 2024 -
How to cut water usage in cloud data centers
November 28, 2024 -
Zesty introduces automated Kubernetes optimization platform
November 17, 2024 -
The Perils of Automation Sprawl in the Cloud and How to Prevent Them
October 25, 2024