Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanthreddy29 committed Oct 4, 2024
1 parent 300d33b commit 1a823a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/terraform/aws/eks/karpenter/NodeClass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
run_id: "${RUN_ID}"
securityGroupSelectorTerms:
- tags:
run_id: "${RUN_ID}"
karpenter.sh/discovery: ${CLUSTER_NAME}
amiSelectorTerms:
- alias: al2@latest
tags:
Expand Down
10 changes: 10 additions & 0 deletions modules/terraform/aws/eks/karpenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ data "aws_iam_role" "cluster_role" {
name = var.cluster_iam_role_name
}

data "aws_eks_cluster" "cluster" {
name = var.cluster_name
}

resource "aws_ec2_tag" "cluster_primary_security_group" {
resource_id = data.aws_eks_cluster.cluster.vpc_config[0].cluster_security_group_id
key = "karpenter.sh/discovery"
value = var.cluster_name
}

resource "aws_iam_role" "karpenter_node_role" {
name = substr("KarpenterNodeRole-${var.cluster_name}", 0, 60)
tags = var.tags
Expand Down

0 comments on commit 1a823a7

Please sign in to comment.