-
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathtalos_config_worker.tf
More file actions
59 lines (56 loc) · 1.83 KB
/
Copy pathtalos_config_worker.tf
File metadata and controls
59 lines (56 loc) · 1.83 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
51
52
53
54
55
56
57
58
59
locals {
# Worker Config
worker_talos_config_patches = {
for name, node in hcloud_server.worker : name => [
{
machine = {
nodeLabels = merge(
local.worker_nodepools_map[node.labels.nodepool].labels,
{ "nodeid" = tostring(node.id) }
)
nodeAnnotations = local.worker_nodepools_map[node.labels.nodepool].annotations
kubelet = {
extraConfig = merge(
{
registerWithTaints = local.worker_nodepools_map[node.labels.nodepool].taints
systemReserved = {
cpu = "100m"
memory = "300Mi"
ephemeral-storage = "1Gi"
}
kubeReserved = {
cpu = "100m"
memory = "350Mi"
ephemeral-storage = "1Gi"
}
},
var.kubernetes_kubelet_extra_config
)
}
}
},
{
apiVersion = "v1alpha1"
kind = "HostnameConfig"
hostname = name
auto = "off"
}
]
}
}
data "talos_machine_configuration" "worker" {
for_each = toset(keys(hcloud_server.worker))
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.worker_talos_config_patches[each.key] : yamlencode(patch)],
[for patch in var.worker_config_patches : yamlencode(patch)]
)
}