- It is a valuable tool for automating and optimizing node management in Kubernetes clusters, providing better resource utilization, scalability, and reliability. That's why it helps to reduce the cost as well.
-
After installation, Karpenter monitors unschedulable Pods in the cluster. Provisioning new Nodes requires at least one NodePool, which introduces the concept of NodeClass.
- NodeClass is set of AWS-specific configurations such as AMI, resource tags, EBS mappings, etc.
- NodePool is a set of Node requirements: Availability Zone, CPU amount, Instance family, etc
-
Karpenter actively monitors free Node capacity, rescheduling existing Pods to minimize the provisioned Node capacity.
-
terraform init
-
terraform apply
-
terraform apply
-
to connect to the cluster you need to update the Kubernetes context:
- aws eks update-kubeconfig --name test --region eu-north-1
3. Create Karpenter Controller IAM Role ( [08-09] terraform files and controller-trust-policy.json file)
-
terraform init
-
terraform apply
-
terraform apply
-
Check if the helm has been deployed successfully.
-
helm list -A NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION karpenter karpenter 1 2023-10-13 16:08:27.073106337 +0200 CEST deployed karpenter-0.16.3 0.16.3
-
kubectl apply -f provisioner.yaml
kubectl apply -f deployment.yaml
- A new node that has 5 new pods will be created.
-
terraform plan -destroy
-
terraform apply -destroy
-
eks-node-viewer is a tool for visualizing dynamic node usage within a cluster.
- It displays the scheduled pod resource requests vs the allocatable capacity on the node.
- It does not look at the actual pod resource usage.
-
Installation
- brew tap aws/tap
- brew install eks-node-viewer
-
Usage
- eks-node-viewer
2* https://github.com/aws/karpenter
3* Kubernetes Node Autoscaling with Karpenter (AWS EKS & Terraform) - Anton Putra - Youtube
4* Kubernetes Node Autoscaling with Karpenter (AWS EKS & Terraform) - Anton Putra - Blog
5* Karpenter vs Kubernetes Cluster Autoscaler - Justin Garrison
6* Karpenter for Kubernetes | Karpenter vs Cluster Autoscaler
7* Fine-Tuning EKS Clusters with Karpenter: DevOps Insights - Yevhen Chemerys