Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update karpenter to the latest version #357

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading