Skip to content

Commit b9feda8

Browse files
authored
Reintroduce Cluster Autoscaler label and taint tags (#221)
* fix: Add autoscaler label and taint tags to node_group_tags * fix: Update launch template to use local.node_tags for tags
1 parent 1388655 commit b9feda8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

launch-template.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ locals {
5656
}
5757
vpc_security_group_ids = local.launch_template_vpc_security_group_ids
5858
user_data = local.userdata
59-
tags = local.node_group_tags
59+
tags = local.node_tags
6060
cpu_options = var.cpu_options
6161
placement = var.placement
6262
enclave_options = var.enclave_enabled ? ["true"] : []

main.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ locals {
4444
"k8s.io/cluster-autoscaler/${var.cluster_name}" = "owned"
4545
"k8s.io/cluster-autoscaler/enabled" = "true"
4646
}
47+
*/
48+
# AWS does not currently apply the autoscaler autodiscovery label/taint tags to the node group.
4749
autoscaler_kubernetes_label_tags = {
4850
for label, value in var.kubernetes_labels : format("k8s.io/cluster-autoscaler/node-template/label/%v", label) => value
4951
}
5052
autoscaler_kubernetes_taints_tags = {
5153
for taint in var.kubernetes_taints : format("k8s.io/cluster-autoscaler/node-template/taint/%v", taint.key) =>
5254
"${taint.value == null ? "" : taint.value}:${local.taint_effect_map[taint.effect]}"
5355
}
54-
56+
/*
5557
5658
node_tags = merge(
5759
module.label.tags,
@@ -65,8 +67,12 @@ locals {
6567
# because they only matter when applied to the autoscaling group.
6668
node_group_tags = local.node_tags
6769
*/
68-
node_tags = module.label.tags
69-
node_group_tags = module.label.tags
70+
node_tags = module.label.tags
71+
node_group_tags = merge(
72+
module.label.tags,
73+
local.autoscaler_kubernetes_label_tags,
74+
local.autoscaler_kubernetes_taints_tags
75+
)
7076
}
7177

7278
module "label" {

0 commit comments

Comments
 (0)