Skip to content

Commit

Permalink
update karpenter to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Glotov committed Aug 23, 2024
1 parent d8b659d commit 7c9418b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions terraform/modules/k8s-karpenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
enabled = true
chart = try(var.helm.chart_name, "karpenter")
repository = try(var.helm.repository, "oci://public.ecr.aws/karpenter")
chart_version = try(var.helm.chart_version, "0.37.0")
chart_version = try(var.helm.chart_version, "1.0.0")
namespace = try(var.helm.namespace, "karpenter")
}

Expand Down Expand Up @@ -66,13 +66,14 @@ resource "kubectl_manifest" "ec2nodeclass_private" {
count = local.karpenter.enabled ? 1 : 0

yaml_body = <<EOF
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
metadata:
name: private
namespace: ${local.karpenter.namespace}
spec:
amiFamily: AL2023 # Amazon Linux 2023
amiSelectorTerms:
- alias: al2023@latest
role: ${var.node_group_default_iam_role_name} # replace with your cluster name NODE ROLE ID from the aws-eks
subnetSelectorTerms:
- tags:
Expand All @@ -97,13 +98,14 @@ resource "kubectl_manifest" "ec2nodeclass_public" {
count = local.karpenter.enabled ? 1 : 0

yaml_body = <<EOF
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
metadata:
name: public
namespace: ${local.karpenter.namespace}
spec:
amiFamily: AL2023 # Amazon Linux 2023
amiSelectorTerms:
- alias: al2023@latest
role: ${var.node_group_default_iam_role_name} # replace with your cluster name NODE ROLE ID from the aws-base
subnetSelectorTerms:
- tags:
Expand Down
14 changes: 8 additions & 6 deletions terragrunt/ACCOUNT_ID/us-east-1/demo/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ single_nat_gateway: true
eks_cluster_version: "1.30"

eks_karpenter_nodepools:
- apiVersion: karpenter.sh/v1beta1
- apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand Down Expand Up @@ -64,15 +64,16 @@ eks_karpenter_nodepools:
imageGCLowThresholdPercent: 80
cpuCFSQuota: true

expireAfter: 720h

disruption:
consolidationPolicy: WhenUnderutilized
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized

limits:
cpu: "1000"
memory: 1000Gi

- apiVersion: karpenter.sh/v1beta1
- apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: ci
Expand Down Expand Up @@ -125,9 +126,10 @@ eks_karpenter_nodepools:
imageGCLowThresholdPercent: 80
cpuCFSQuota: true

expireAfter: 720h

disruption:
consolidationPolicy: WhenUnderutilized
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized

limits:
cpu: "1000"
Expand Down

0 comments on commit 7c9418b

Please sign in to comment.