From e048984da987fab66e35944dfb371c1ec3ecf9b9 Mon Sep 17 00:00:00 2001 From: Valentin Khramtsov Date: Wed, 25 Sep 2024 20:26:15 +0300 Subject: [PATCH 1/3] Fixes for karpenter deploy --- terraform/modules/k8s-karpenter/main.tf | 18 ++++++++++-------- .../demo/common/aws-eks/.terraform.lock.hcl | 10 ++++++++-- .../demo/common/aws-vpc/.terraform.lock.hcl | 3 ++- terragrunt/ACCOUNT_ID/us-east-1/demo/env.yaml | 6 ++++++ .../demo/karpenter/.terraform.lock.hcl | 9 ++++++++- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/terraform/modules/k8s-karpenter/main.tf b/terraform/modules/k8s-karpenter/main.tf index f9f4dec..50ebc86 100644 --- a/terraform/modules/k8s-karpenter/main.tf +++ b/terraform/modules/k8s-karpenter/main.tf @@ -3,8 +3,8 @@ locals { karpenter = { name = try(var.helm.release_name, "karpenter") enabled = true - chart = try(var.helm.chart_name, "karpenter") - repository = try(var.helm.repository, "oci://public.ecr.aws/karpenter") + chart = try(var.helm.chart_name, "oci://public.ecr.aws/karpenter/karpenter") + repository = try(var.helm.repository, "") chart_version = try(var.helm.chart_version, "1.0.0") namespace = try(var.helm.namespace, "karpenter") } @@ -19,6 +19,12 @@ serviceAccount: annotations: eks.amazonaws.com/role-arn: ${module.this[0].iam_role_arn} +postInstallHook: + image: + repository: bitnami/kubectl + tag: "1.30" + digest: sha256:c85f429088cea9ad968752e6d59e7edbc74b5750526f9a04531dce6b37f3ac87 + controller: resources: requests: @@ -30,8 +36,6 @@ controller: VALUES } -data "aws_ecrpublic_authorization_token" "token" {} - module "this" { count = local.karpenter.enabled ? 1 : 0 @@ -66,7 +70,7 @@ resource "kubectl_manifest" "ec2nodeclass_private" { count = local.karpenter.enabled ? 1 : 0 yaml_body = < Date: Thu, 26 Sep 2024 09:50:53 +0300 Subject: [PATCH 2/3] Updated karpenter helm chart version --- terraform/modules/k8s-karpenter/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/modules/k8s-karpenter/main.tf b/terraform/modules/k8s-karpenter/main.tf index 50ebc86..d2ac9c1 100644 --- a/terraform/modules/k8s-karpenter/main.tf +++ b/terraform/modules/k8s-karpenter/main.tf @@ -5,7 +5,7 @@ locals { enabled = true chart = try(var.helm.chart_name, "oci://public.ecr.aws/karpenter/karpenter") repository = try(var.helm.repository, "") - chart_version = try(var.helm.chart_version, "1.0.0") + chart_version = try(var.helm.chart_version, "1.0.3") namespace = try(var.helm.namespace, "karpenter") } From 4615d05e10bb8ae367eda090554467f848c27f43 Mon Sep 17 00:00:00 2001 From: Valentin Khramtsov Date: Thu, 26 Sep 2024 09:53:46 +0300 Subject: [PATCH 3/3] Removed postInstallHook from values for karpenter helm chart --- terraform/modules/k8s-karpenter/main.tf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/terraform/modules/k8s-karpenter/main.tf b/terraform/modules/k8s-karpenter/main.tf index d2ac9c1..ef0cf74 100644 --- a/terraform/modules/k8s-karpenter/main.tf +++ b/terraform/modules/k8s-karpenter/main.tf @@ -19,12 +19,6 @@ serviceAccount: annotations: eks.amazonaws.com/role-arn: ${module.this[0].iam_role_arn} -postInstallHook: - image: - repository: bitnami/kubectl - tag: "1.30" - digest: sha256:c85f429088cea9ad968752e6d59e7edbc74b5750526f9a04531dce6b37f3ac87 - controller: resources: requests: