Skip to content

Commit

Permalink
chore: Update Karpenter MNG pattern to use updated module w/ pod iden…
Browse files Browse the repository at this point in the history
…tity association included (#1944)
  • Loading branch information
bryantbiggs committed May 9, 2024
1 parent a4ecf26 commit 4e6d83b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion patterns/karpenter-mng/README.md
Expand Up @@ -13,7 +13,7 @@ This pattern demonstrates how to provision Karpenter on an EKS managed node grou

The areas of significance related to this pattern are highlighted in the code provided below:

```terraform hl_lines="20-28 31 49-62 67-70 89-91 97-100 108-132"
```terraform hl_lines="20-28 31 49-62 67-70 89-92 102-126"
{% include "../../patterns/karpenter-mng/eks.tf" %}
```

Expand Down
14 changes: 4 additions & 10 deletions patterns/karpenter-mng/eks.tf
Expand Up @@ -4,7 +4,7 @@

module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "~> 20.9"
version = "~> 20.10"

cluster_name = local.name
cluster_version = "1.29"
Expand Down Expand Up @@ -87,19 +87,13 @@ module "karpenter" {
cluster_name = module.eks.cluster_name

# Name needs to match role name passed to the EC2NodeClass
node_iam_role_use_name_prefix = false
node_iam_role_name = local.name
node_iam_role_use_name_prefix = false
node_iam_role_name = local.name
create_pod_identity_association = true

tags = local.tags
}

resource "aws_eks_pod_identity_association" "karpenter" {
cluster_name = module.eks.cluster_name
namespace = "kube-system"
service_account = "karpenter"
role_arn = module.karpenter.iam_role_arn
}

################################################################################
# Helm charts
################################################################################
Expand Down

0 comments on commit 4e6d83b

Please sign in to comment.