ot-karpenter

by genofire

Helm chartv0.3.0

About this chart

Karpenter

Karpenter is an open-source Kubernetes cluster autoscaler built for efficiency and speed. This Helm chart installs Karpenter in your Kubernetes cluster and can be used to manage your node pools for dynamically scaling your infrastructure. This chart supports automated deployment of Karpenter, including the creation of NodePools, EC2NodeClasses, IAM roles, and other necessary resources.

To install Karpenter, use the following commands:

$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
$ helm install karpenter ot-helm/karpenter --namespace <namespace> --dependency-update --create-namespace

Adds the ot-helm repository to Helm, which contains the Karpenter Helm chart. Installs the Karpenter chart from the ot-helm repository.

To upgrade the setup:

$ helm upgrade karpenter ot-helm/karpenter --install --namespace <namespace> --create-namespace

Upgrades an existing Karpenter release or installs it if it doesn't exist.

To uninstall the chart:

$ helm delete karpenter --namespace <namespace>

Deletes the Karpenter release from the specified namespace. Replace with the namespace where Karpenter is installed.

Pre-Requisites

  • Kubernetes => 1.18+
  • Helm => 3.X
  • Karpenter Operator => 0.1.0
  • Open ID Connector (EKS) => https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html
  • IAM Roles for Karpenter
  • Add tags to subnets and security groups
  • Update aws-auth ConfigMap

Parameters

NameValueDescription
karpenter.settings.clusterNamemy-clusterThe name of your Kubernetes cluster
karpenter.serviceAccount.annotations.eks.amazonaws.com/role-arnRequiredIAM role ARN for Karpenter controller
karpenter.controller.resources.requests.cpu1CPU request for Karpenter controller
karpenter.controller.resources.requests.memory1GiMemory request for Karpenter controller
karpenter.controller.resources.limits.cpu1CPU limit for Karpenter controller
karpenter.controller.resources.limits.memory1GiMemory limit for Karpenter controller
nodePools[]List of NodePools to be created
nodePools.namedefault-nodepoolName of the NodePool
nodePools.labels - If not required can be omitted{}Labels for the NodePool
nodePools.annotations - If not required can be omitted{}Annotations for the NodePool
nodePools.requirements - Can be empty [][]Node requirements like CPU, memory, etc.
nodePools.taints - If not required can be omitted[]Taints for the NodePool
nodePools.expireAfter720hExpiration duration for idle NodePools
nodePools.limits.cpu - Required Field"1000m"CPU limit for the NodePool
nodePools.limits.memory- If not required can be omitted"2Gi"Memory limit for the NodePool
nodePools.disruption.consolidationPolicy - Required FieldWhenEmptyOrUnderutilizedConsolidation policy for underutilized nodes
nodePools.disruption.consolidateAfter - Required Field1mTime before consolidating underutilized nodes

Notes:

  • Refer to Example Folder for a example values.yaml file
  • Karpenter automatically creates and manages NodePools as part of the installation process.
  • Make sure to configure the IAM roles required by Karpenter for it to interact with EC2 instances and manage resources along with all prerequisites.
  • The chart will ensure the Karpenter controller and NodePools are deployed correctly with all required configurations.

Deploy ot-karpenter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ot-karpenter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartot-karpenter is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply