diff --git a/infrastructure/eks_cluster/README.md b/infrastructure/eks_cluster/README.md index 2de0a82..d4577da 100644 --- a/infrastructure/eks_cluster/README.md +++ b/infrastructure/eks_cluster/README.md @@ -119,6 +119,8 @@ module "eks" { | [eks\_access\_entries](#input\_eks\_access\_entries) | Map of EKS Access Entries | `map(any)` | `{}` | no | | [enable\_private\_zone](#input\_enable\_private\_zone) | Enable Private Route53 Zone | `bool` | `false` | no | | [environment](#input\_environment) | (Required) Environment e.g Dev, Stg, Prod | `string` | n/a | yes | +| [karpenter\_namespace](#input\_karpenter\_namespace) | Namespace for Pod Identity Mapping | `string` | `"karpenter"` | no | +| [karpenter\_service\_account](#input\_karpenter\_service\_account) | Service Account for Pod Identity Mapping | `string` | `"karpenter"` | no | | [kms\_key\_rotation\_days](#input\_kms\_key\_rotation\_days) | Number of days to rotate the KMS key for EKS managed node group volume encryption | `number` | `365` | no | | [node\_groups\_attributes](#input\_node\_groups\_attributes) | Node Group Properties. Used to Provision EKS node groups | `map(any)` | n/a | yes | | [node\_security\_group\_additional\_rules](#input\_node\_security\_group\_additional\_rules) | Additional Rules for Node Security Group | `map(any)` | `{}` | no | diff --git a/infrastructure/eks_cluster/main.tf b/infrastructure/eks_cluster/main.tf index 378882d..e694116 100644 --- a/infrastructure/eks_cluster/main.tf +++ b/infrastructure/eks_cluster/main.tf @@ -272,6 +272,8 @@ module "karpenter" { create_pod_identity_association = true create_instance_profile = false create_access_entry = true + namespace = var.karpenter_namespace + service_account = var.karpenter_service_account node_iam_role_additional_policies = merge({ AmazonSSMManagedInstanceCore = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" }, var.additional_cluster_policies) diff --git a/infrastructure/eks_cluster/variable.tf b/infrastructure/eks_cluster/variable.tf index 8a0b7a9..6b630b7 100644 --- a/infrastructure/eks_cluster/variable.tf +++ b/infrastructure/eks_cluster/variable.tf @@ -104,3 +104,15 @@ variable "kms_key_rotation_days" { description = "Number of days to rotate the KMS key for EKS managed node group volume encryption" default = 365 } + +variable "karpenter_namespace" { + type = string + description = "Namespace for Pod Identity Mapping" + default = "karpenter" +} + +variable "karpenter_service_account" { + type = string + description = "Service Account for Pod Identity Mapping" + default = "karpenter" +}