truemark / terraform-aws-eks

Standard TrueMark AWS EKS Terraform module
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

node scalers: karpenter and castai #121

Closed v47 closed 1 month ago

v47 commented 1 month ago

Add to required providers if it's not added:

    http = {
      source  = "hashicorp/http"
      version = "~> 1.2.0"
    }

Needed to be removed from the state file

module.eks.kubectl_manifest.karpenter_crds["karpenter.k8s.aws_ec2nodeclasses.yaml"]
module.eks.kubectl_manifest.karpenter_crds["karpenter.sh_nodeclaims.yaml"]
module.eks.kubectl_manifest.karpenter_crds["karpenter.sh_nodepools.yaml"] 

After the diff will be Plan: 1 to add, 1 to change The Karpenter CRDs will be deployed as a separate helm chart and the controller chart will not manage CRDs anymore.

kubectl patch crd ec2nodeclasses.karpenter.k8s.aws -p '{"metadata": {"labels": {"app.kubernetes.io/managed-by": "Helm", "meta.helm.sh/release-name": "karpenter-crd", "meta.helm.sh/release-namespace": "karpenter"}}}'
kubectl annotate crd ec2nodeclasses.karpenter.k8s.aws meta.helm.sh/release-name=karpenter-crd meta.helm.sh/release-namespace=karpenter 
kubectl patch crd nodeclaims.karpenter.sh -p '{"metadata": {"labels": {"app.kubernetes.io/managed-by": "Helm", "meta.helm.sh/release-name": "karpenter-crd", "meta.helm.sh/release-namespace": "karpenter"}}}'
kubectl annotate crd nodeclaims.karpenter.sh meta.helm.sh/release-name=karpenter-crd meta.helm.sh/release-namespace=karpenter
kubectl patch crd nodepools.karpenter.sh -p '{"metadata": {"labels": {"app.kubernetes.io/managed-by": "Helm", "meta.helm.sh/release-name": "karpenter-crd", "meta.helm.sh/release-namespace": "karpenter"}}}'
kubectl annotate crd nodepools.karpenter.sh meta.helm.sh/release-name=karpenter-crd meta.helm.sh/release-namespace=karpenter

After migration to the separate helm chart to manage karpenter crds is possible to migrate to karpenter v1... Follow https://karpenter.sh/v1.0/upgrading/v1-migration/#upgrade-procedure using variable

enable_karpenter_controller_webhook
enable_karpenter_crd_webhook
karpenter_controller_version
karpenter_crds_version