Skip to content

Commit

Permalink
fix: Use the launch_template_tags on the launch template (#2957)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Mar 7, 2024
1 parent 71b5031 commit 0ed32d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/eks_managed_node_group/main.tf
Expand Up @@ -264,6 +264,12 @@ module "eks" {
additional = aws_iam_policy.node_additional.arn
}

launch_template_tags = {
# enable discovery of autoscaling groups by cluster-autoscaler
"k8s.io/cluster-autoscaler/enabled" : true,
"k8s.io/cluster-autoscaler/${local.name}" : "owned",
}

tags = {
ExtraTag = "EKS managed node group complete example"
}
Expand Down
5 changes: 4 additions & 1 deletion modules/eks-managed-node-group/main.tf
Expand Up @@ -312,7 +312,10 @@ resource "aws_launch_template" "this" {
user_data = module.user_data.user_data
vpc_security_group_ids = length(local.network_interfaces) > 0 ? [] : local.security_group_ids

tags = var.tags
tags = merge(
var.tags,
var.launch_template_tags,
)

# Prevent premature access of policies by pods that
# require permissions on create/destroy that depend on nodes
Expand Down

0 comments on commit 0ed32d7

Please sign in to comment.