United States

Setting Up an EKS Cluster with Karpenter on Graviton Processors

Setting Up an EKS Cluster with Karpenter on Graviton Processors

Introduction

 

In the rapidly evolving world of Kubernetes, efficiency and optimization are paramount. AWS offers two powerful tools to address these needs: EKS for managed Kubernetes services and Graviton processors for cost-effective, high-performance computing. Karpenter, AWS’s auto-scaling solution, brings these technologies together, offering a dynamic, responsive environment that scales according to workload demands. This guide walks you through setting up an Amazon EKS cluster using version 1.28, configured with Karpenter to leverage Graviton processors, all orchestrated with the latest version of Terraform.

Prerequisites


Before diving into the setup, ensure you have the following:

  • An AWS account with appropriate permissions to create EKS clusters, manage IAM roles, and operate with EC2 instances.
  • Terraform installed on your machine. This guide assumes you are using the latest version of Terraform.
  • AWS CLI installed and configured with access credentials.

What we used for the deployment

 
  • Official Terraform EKS Module: This refers to a pre-built module provided by HashiCorp’s Terraform Registry, specifically designed for creating and managing Amazon Elastic Kubernetes Service (EKS) clusters. Using this module simplifies the process of deploying an EKS cluster because it encapsulates a lot of the required AWS resource definitions (like VPCs, IAM roles, and EKS clusters) into a reusable and configurable format. Users can leverage this module to avoid writing extensive resource definitions from scratch, ensuring best practices and reducing the risk of configuration errors.
  • Karpenter Helm (v0.33.0): Karpenter is an open-source, flexible, high-performance Kubernetes cluster autoscaler developed by AWS. The specific mention of “Helm (v0.33.0)” indicates the use of Helm, a package manager for Kubernetes, to deploy Karpenter version 0.33.0 onto the EKS cluster. Helm charts simplify the deployment and management of applications on Kubernetes clusters by packaging all necessary components into a single, deployable unit. By specifying the version (v0.33.0), the deployment ensures consistency and reliability, as all features and functionalities are known and documented for this particular version.

Deployment

 

   Step1: EKS Deployment:

  1. We utilised Cluster version 1.28 and employed Graviton t4g.medium as the node type.
  2. This configuration outlines the managed nodegroup settings within the EKS module, with the nodes specifically tainted for Karpenter use.
  3. Karpenter will be installed using Helm, facilitated by Terraform, which will deploy a dedicated node specifically for Karpenter. 

     Step2: Karpenter NodePool Deployment:

  1. Pods status after the Karpenter Installation.
  2. The NodePool resource allows users to define a pool of nodes with specific configurations that Karpenter should maintain. This concept simplifies the management of clusters by allowing for the specification of node properties such as instance types, sizes, labels, taints, and more, within a defined pool. This makes it easier to organise and manage nodes according to their intended purposes, such as differentiating between compute-optimised nodes and memory-optimised nodes for various workloads.
  3. In this process, we are deploying a nodepool template to the cluster. Subsequently, we observe that a nodeclaim is initiated and a new node begins to operate, conforming to the specifications of the matching template.
  4. Can see a node with Graviton instance type.

Conclusion

 

Karpenter provides a modern, flexible approach to auto-scaling in Kubernetes environments, reducing the reliance on static node pools and offering a more efficient way to manage compute resources. By dynamically provisioning nodes based on actual workload requirements, Karpenter can help optimise costs, improve performance, and increase the overall efficiency of Kubernetes clusters. Whether used alongside traditional node pools or as a standalone scaling solution, Karpenter offers significant advantages for Kubernetes administrators and developers looking to streamline their operations.

Anoop
Anoop

I'm a DevOps/DevSecOps engineer focused on creating smooth and reliable software/infrastructure experiences. I enjoy working with AWS, Kubernetes, Terraform, and GitOps to build reliable, automated systems that make life easier for development teams. Certified in AWS, Kubernetes, and Red Hat, I also contribute to open-source projects. Outside work, I'm always looking to learn more, refine my skills, and share insights from my experiences in tech.

Related Posts