Provisioning Karpenter requires a number of manual steps. This repository aims to automate those steps using Terraform
You should have the following installed in your machine:
- AWS CLI
- kubectl
- ekstcl - This is necessary to modify
aws-auth- Refer to null-resource
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.yamlAll 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 applyDeploy the default Provisioner manifest file that is created automatically
kubectl apply -f default-provisioner.yamlkubectl apply -f sample-workload/pause.yamlTo delete the Karpenter, use the following command
terraform destroyTo delete the whole cluster use the following command
eksctl delete cluster --region=ap-southeast-1 --name=eks-clusterIf you face any issues in cleaning up the resource, check the CloudFormation dashboard in the AWS console or delete the appropriate stack from there