Skip to content

gucarreira/karpenter-terraform

 
 

Repository files navigation

Provisioning Karpenter using Terraform

Introduction

Provisioning Karpenter requires a number of manual steps. This repository aims to automate those steps using Terraform

Prerequisites

You should have the following installed in your machine:

(Optional) Create Cluster

If you don't already have a cluster, adjust the cluster definition file and create one. Else, skip this step.

eksctl create cluster -f cluster/eks-cluster.yaml

Deploy Karpenter

All the related terraform templates are available in the karpenter folder. It contains karpenter provisioner, Bottlerocket launch template and IAM roles, polcies needed for Karpenter.

Adjust variables in terraform.tfvars and deploy

cd karpenter
terraform init
terraform apply

Deploy the default Provisioner manifest file that is created automatically

kubectl apply -f default-provisioner.yaml

Test with sample application

kubectl apply -f sample-workload/pause.yaml

Cleanup

To delete the Karpenter, use the following command

terraform destroy

To delete the whole cluster use the following command

eksctl delete cluster --region=ap-southeast-1 --name=eks-cluster

If you face any issues in cleaning up the resource, check the CloudFormation dashboard in the AWS console or delete the appropriate stack from there

About

Terraform module and installation script for Karpenter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 92.6%
  • Smarty 7.4%