In this self-paced exercise, you will learn how to configure, deploy and test Karpenter within an Amazon EKS cluster using add-ons, blueprints and workloads. You will configure Karpenter to deploy Spot instances to save costs.
Karpenter helps improve your application availability and cluster efficiency by rapidly launching right-sized compute resources in response to changing application loads. When Karpenter is installed in your cluster, Karpenter observes the aggregate resource requests of unscheduled pods and makes decisions to launch new nodes and terminate them to reduce scheduling latencies and infrastructure costs.
Karpenter is faster provisioning instances and scheduling pods than Cluster Autoscaler. Along with enhanced speed, Karpenter will choose the best suitable instance type for the required pod workloads. This leads to more efficient node sizing and reduced administrative configuration. Unlike Cluster Autoscaler, there is no need to configure and manage node groups for each instance type to be used, Karpenter has access to all instance types natively. Karpenter is considered to be faster and simplier to configure, however, it is only currently supported on AWS.
When using Spot instances, it is a best practice to implement an instance diversification strategy. In this example, you will configure Karpenter with a list of instance types it can use to manage Spot instances.
What Will You Do by Part¶
|Part||What will you do?|
|1||Setup and Configuration|
|2||Provision an Amazon EKS Cluster|
|3||Cluster Blueprint with Karpenter|
|4||Deploy a test Workload to the EKS cluster to activate Karpenter|
|5||Deprovision the EKS cluster|
Architecture & Design¶
- It is recommended to create a "dedicated managed node group" for system level resources and spot instance based nodes managed by Karpenter to run non-system level workloads.
- This configuration allows system level resources to take advantage of the consistency of on-demand or reserved instances while optimizing workload cost with performance.
In this exercise, we will create an EKS cluster that contains one managed node groups for system resources. The spot instances will be managed by Karpenter. A visual representation of this cluster design is shown below..
flowchart LR subgraph dataplane[EKS Data Plane] direction LR subgraph NG1[System Node Group] direction RL i1[Rafay Operator] karpenter[Karpenter] end node1[EC2 Spot Instance] node2[EC2 Spot Instance] karpenter-->node1 karpenter-->node2 end controlplane[EKS Control Plane] <===> dataplane
- You have access to an Amazon AWS account with privileges to create an IAM Role with the default Full IAM Policy to allow provisioning of resources on your behalf as part of the EKS cluster lifecycle.
- You have the AWS CLI installed and configured