Skip to content

Latest commit

 

History

History
100 lines (55 loc) · 3.28 KB

ReadMe.MD

File metadata and controls

100 lines (55 loc) · 3.28 KB

WIP

Why Karpenter?

  • 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.

How it works? (7*)

  • 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.

  • How It works (8*)

1. Create AWS VPC ( [00-05] terraform files)

  • terraform init

  • terraform apply

2. Create EKS Cluster and a Node group ( [06-07] terraform files)

  • 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

4. Deploy Karpenter to EKS ( [10] terraform file)

  • 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
      

5. Create Karpenter Provisioner

kubectl apply -f provisioner.yaml

6. Demo: Automatic Node Provisioning

kubectl apply -f deployment.yaml

  • A new node that has 5 new pods will be created.

7. After the tests - Delete all the AWS Resources that we have created

  • terraform plan -destroy

  • terraform apply -destroy

EKS Node Viewer (9*)

  • 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

Resources

1* https://karpenter.sh/

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

8* Karpenter: EKS Cluster Autoscaling

9* https://github.com/awslabs/eks-node-viewer