Karpenter in Kubernetes who shapes and sharpens cluster nodes scaling .

ORIGINATES: -

Karpenter word originates from French Norman Carpentier (le Carpentier, le Charpentier), a worker of wood, derived from the late Latin "carpentarius", a maker of wooden carriages.

What is Karpenter?

Karpenter is an open-source, flexible, high-performance Kubernetes cluster Autoscaler built with AWS.

What is Autoscaler?

On AWS, Cluster Autoscaler utilizes Amazon EC2 Auto Scaling Groups to manage node groups. Cluster Autoscaler typically runs as a Deployment in your cluster.

Before we jump into comparison why Karpenter is special in the world of Kubernetes. There are two mains built in services that makes its possible .

Allocator: - Its responsible for allocating unscheduled pods to nodes with least amount of latency.

Reallocator: - Its responsible for reallocating the pods when observes the nodes are not running at its maximum utilization.

Pic Courtesy: - @Vempa Siddhartha

Karpenter vs Cluster Autoscaler: Side-by-side Comparison

There are a few factors to consider while choosing Karpenter or Cluster Autoscaler. Let's look at the detailed comparison of each so that you can make an informed decision.

Parameter 

AWS Karpenter

Kubernetes Cluster Autoscaler

Upscaling

Karpenter offers more intelligent scaling capabilities to detect specific workload requirements. Based on that it divides resources. This means that it can scale up based on actual usage.

Cluster Autoscaler focuses more on node-level scaling. That means it can add more nodes to the cluster to meet increased demand.

Downscaling

Karpenter offers more granular and fine-grained control over downscaling. It allows you to specify rules and policies for when and how to scale down based on workload requirements. This can help prevent underutilization and reduce costs. 

Cluster Autoscaler focuses more on node-level scaling. That means it may be less effective in downscaling specific resources. However, it does have the advantage as well. It can be more established and reliable in production environments. 

Maturity 

Karpenter is a newer solution that is still in active development. Since AWS backs it and has the potential for great scalability and efficiency. But it may not yet have the same level of maturity and stability as Cluster Autoscaler.

Cluster Autoscaler has a clear advantage. That has been around for much longer than Karpenter. It is also battle-tested in many production environments. It is a well-established and reliable solution. That can be optimized for a variety of Kubernetes configurations and use cases.

Scheduling Configuration 

Karpenter can schedule workloads based on specific criteria. The criteria can be resource requirements, availability zones, and cost. It can optimize workload scheduling to cut costs and maximize efficiency. But might need more configuration and fine-tuning to get the scheduling right.

Cluster Autoscaler is simpler scheduling. It is designed to scale up or down based on demand. It may not have the same level of scheduling granularity as Karpenter. But it is generally more reliable and requires less maintenance.

Availability 

Karpenter is built on top of Kubernetes. It is designed to be available and fault-tolerant. This means that Karpenter can use Kubernetes' robust infrastructure. And also, failover mechanisms to ensure that it is always up and running.  

Cluster Autoscaler is a standalone tool. It can be installed on any Kubernetes cluster. It also has mechanisms to ensure high availability. That includes leader election and automatic failover. But since it is not integrated with Kubernetes like Karpenter. So, it may need more manual intervention to maintain availability in certain situations. 

Installation

Karpenter is a native component of AWS EKS and can be easily enabled through a few simple commands. This makes it a breeze to set up and use, especially if you already use AWS EKS.

Autoscaler can also be install using kubectl commands utility under AWS.