-
Notifications
You must be signed in to change notification settings - Fork 45
/
helm_cluster_autoscaler.tf
54 lines (42 loc) · 1.08 KB
/
helm_cluster_autoscaler.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
resource "helm_release" "cluster_autoscaler" {
count = var.cluster_autoscaler_toggle ? 1 : 0
repository = "https://kubernetes.github.io/autoscaler"
chart = "cluster-autoscaler"
name = "aws-cluster-autoscaler"
version = "9.29.1"
namespace = "kube-system"
create_namespace = true
set {
name = "replicaCount"
value = 1
}
set {
name = "awsRegion"
value = var.aws_region
}
set {
name = "rbac.serviceAccount.create"
value = true
}
set {
name = "rbac.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
value = aws_iam_role.cluster_autoscaler_role[count.index].arn
}
set {
name = "autoscalingGroups[0].name"
value = aws_eks_node_group.main.resources[0].autoscaling_groups[0].name
}
set {
name = "autoscalingGroups[0].maxSize"
value = lookup(var.auto_scale_options, "max")
}
set {
name = "autoscalingGroups[0].minSize"
value = lookup(var.auto_scale_options, "min")
}
depends_on = [
aws_eks_cluster.main,
aws_eks_node_group.main,
kubernetes_config_map.aws-auth
]
}