Skip to content

Commit

Permalink
fix: Only tag cluster node security group for Karpenter (#1985)
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Allamand <[email protected]>
  • Loading branch information
allamand authored Aug 5, 2024
1 parent 054f260 commit 1975b53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion patterns/karpenter-mng/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ module "eks" {
}
}

tags = merge(local.tags, {
# cluster_tags = merge(local.tags, {
# NOTE - only use this option if you are using "attach_cluster_primary_security_group"
# and you know what you're doing. In this case, you can remove the "node_security_group_tags" below.
# "karpenter.sh/discovery" = local.name
# })

node_security_group_tags = merge(local.tags, {
# NOTE - if creating multiple security groups with this module, only tag the
# security group that Karpenter should utilize with the following tag
# (i.e. - at most, only one security group should have this tag in your account)
"karpenter.sh/discovery" = local.name
})

tags = local.tags
}

output "configure_kubectl" {
Expand Down
8 changes: 7 additions & 1 deletion patterns/karpenter-mng/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ data "aws_ecrpublic_authorization_token" "token" {
provider = aws.virginia
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
#Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = "ex-${basename(path.cwd)}"
Expand Down

0 comments on commit 1975b53

Please sign in to comment.