aws-ia / terraform-aws-eks-blueprints-addons

Terraform module which provisions addons on Amazon EKS clusters
https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/
Apache License 2.0
272 stars 127 forks source link

feat: Update Karpenter default version to `0.37.0` #404

Closed fabidick22 closed 4 months ago

fabidick22 commented 4 months ago

What does this PR do?

Update default version to v0.37.0

More

For Moderators

Additional Notes

ixolt commented 3 weeks ago

We are encountering an error when applying the latest update:

"error": "launching nodeclaim, resolving ec2nodeclass, object is awaiting reconciliation"

This error is similar to what has been described in this related issue: aws/karpenter-provider-aws#6284.

Impacted Components

This issue also affects the latest version of the AWS EKS Blueprints Add-ons module:

source  = "aws-ia/eks-blueprints-addons/aws"
version = "1.18.3"

Any guidance or fixes related to this would be greatly appreciated.

fabidick22 commented 3 weeks ago

We are encountering an error when applying the latest update:

"error": "launching nodeclaim, resolving ec2nodeclass, object is awaiting reconciliation"

This error is similar to what has been described in this related issue: aws/karpenter-provider-aws#6284.

Impacted Components

This issue also affects the latest version of the AWS EKS Blueprints Add-ons module:

source  = "aws-ia/eks-blueprints-addons/aws"
version = "1.18.3"

Any guidance or fixes related to this would be greatly appreciated.

@ixolt If you have problems with that version of Karpenter, you can set a specific version:

module "eks_blueprints_addons" {
  source = "aws-ia/eks-blueprints-addons/aws"

  karpenter = {
    chart_version = "1.0.6"
  }
}
ixolt commented 2 weeks ago

There are manual steps required as per the documentation

kubectl annotate crd ec2nodeclasses.karpenter.k8s.aws \
  meta.helm.sh/release-name=karpenter-crd \
  meta.helm.sh/release-namespace=karpenter --overwrite

kubectl label crd ec2nodeclasses.karpenter.k8s.aws \
  app.kubernetes.io/managed-by=Helm --overwrite

kubectl annotate crd nodeclaims.karpenter.sh \
  meta.helm.sh/release-name=karpenter-crd \
  meta.helm.sh/release-namespace=karpenter --overwrite

kubectl label crd nodeclaims.karpenter.sh \
  app.kubernetes.io/managed-by=Helm --overwrite

kubectl annotate crd nodepools.karpenter.sh \
  meta.helm.sh/release-name=karpenter-crd \
  meta.helm.sh/release-namespace=karpenter --overwrite

kubectl label crd nodepools.karpenter.sh \
  app.kubernetes.io/managed-by=Helm --overwrite

and adding this helm release(only for version 0.37.+):

# CRD for Karpenter
resource "helm_release" "karpenter_crd" {
  name       = "karpenter-crd"
  repository = "oci://public.ecr.aws/karpenter"
  chart      = "karpenter-crd"
  version    = {...karpenter_version...} <-- same versions as defined in "aws-ia/eks-blueprints-addons/aws"   karpenter = { chart_version = XXX }
  namespace  = "karpenter"
  wait       = true
 }

upgrading to version 1.0.+ requires adding following:

 resource "helm_release" "karpenter_crd" {
  name       = "karpenter-crd"
  repository = "oci://public.ecr.aws/karpenter"
  chart      = "karpenter-crd"
  version    = {...karpenter_version...} <-- same versions as defined in "aws-ia/eks-blueprints-addons/aws"   karpenter = { chart_version = XXX }
  namespace  = "karpenter"
  wait       = true

  set {
    name  = "webhook.enabled"
    value = true
  }
  set {
    name  = "webhook.serviceName"
    value = "karpenter"
  }
  set {
    name  = "webhook.port"
    value = 8443
  }
}

cc #407