Deploy AWS Graviton based EKS cluster using Karpenter

Introduction

Anoop K
3 min readFeb 17, 2024

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 (latest) 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

Deployments are executed in two phases: the first involves deploying to an EKS (Elastic Kubernetes Service) environment, and the second focuses on deploying the Karpenter NodePool. This blog does not provide a comprehensive guide to deploying the entire cluster; instead, it highlights key configurations and the status post-deployment. You can use terraform module for the VPC deployment and use EKS module for managed node group with Karpenter. You can also refer the Karpenter documentation for the provisioner.

Note: Karpenter changed its kind from node provisioner to nodepool

Step 1: 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.

Step 2: Karpenter NodePool Deployment:

For further details and to complete the steps, please visit the official blog post on Stackgenie LINK

--

--

Anoop K

DevOps/DevSecOps Engineer | 2x AWS and Azure certified | CKA | RedHat Linux (RHSA) | Terraform | Golang | And a DevSecOps Enthusiast