chore: Correct example ASG tag(s) to match cluster-autoscaler requirements (#2220)

This commit is contained in:
Thomas Colomb
2022-09-07 16:33:26 +02:00
committed by GitHub
parent 4ca9187d53
commit 9e184dddf4

View File

@@ -675,6 +675,14 @@ data "aws_ami" "eks_default_bottlerocket" {
################################################################################
locals {
# We need to lookup K8s taint effect from the AWS API value
taint_effects = {
NO_SCHEDULE = "NoSchedule"
NO_EXECUTE = "NoExecute"
PREFER_NO_SCHEDULE = "PreferNoSchedule"
}
cluster_autoscaler_label_tags = merge([
for name, group in module.eks.eks_managed_node_groups : {
for label_name, label_value in coalesce(group.node_group_labels, {}) : "${name}|label|${label_name}" => {
@@ -690,7 +698,7 @@ locals {
for taint in coalesce(group.node_group_taints, []) : "${name}|taint|${taint.key}" => {
autoscaling_group = group.node_group_autoscaling_group_names[0],
key = "k8s.io/cluster-autoscaler/node-template/taint/${taint.key}"
value = "${taint.value}:${taint.effect}"
value = "${taint.value}:${local.taint_effects[taint.effect]}"
}
}
]...)