forked from hcloud-k8s/terraform-hcloud-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalos_config_cluster_autoscaler.tf
More file actions
50 lines (47 loc) · 1.62 KB
/
Copy pathtalos_config_cluster_autoscaler.tf
File metadata and controls
50 lines (47 loc) · 1.62 KB
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
locals {
# Autoscaler Config
autoscaler_nodepool_talos_config_patch = {
for nodepool in local.cluster_autoscaler_nodepools : nodepool.name => [
{
machine = {
nodeLabels = nodepool.labels
nodeAnnotations = nodepool.annotations
kubelet = {
extraConfig = merge(
{
registerWithTaints = nodepool.taints
systemReserved = {
cpu = "100m"
memory = "300Mi"
ephemeral-storage = "1Gi"
}
kubeReserved = {
cpu = "100m"
memory = "350Mi"
ephemeral-storage = "1Gi"
}
},
var.kubernetes_kubelet_extra_config
)
}
}
}
]
}
}
data "talos_machine_configuration" "cluster_autoscaler" {
for_each = { for nodepool in local.cluster_autoscaler_nodepools : nodepool.name => nodepool }
talos_version = var.talos_version
cluster_name = var.cluster_name
cluster_endpoint = local.kube_api_url_internal
kubernetes_version = var.kubernetes_version
machine_type = "worker"
machine_secrets = talos_machine_secrets.this.machine_secrets
docs = false
examples = false
config_patches = concat(
[for patch in local.talos_cloud_config_patches : yamlencode(patch)],
[for patch in local.autoscaler_nodepool_talos_config_patch[each.key] : yamlencode(patch)],
[for patch in var.cluster_autoscaler_config_patches : yamlencode(patch)]
)
}