-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathworker.tf
45 lines (39 loc) · 1.43 KB
/
worker.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
module "worker" {
source = "./modules/node-group"
cluster_id = var.cluster_id
region = var.region
role = "worker"
node_count = var.worker_count
node_name_suffix = local.node_name_suffix
image_slug = var.image_slug
flavor_slug = var.worker_flavor
volume_size_gb = var.worker_volume_size_gb
subnet_uuid = cloudscale_subnet.privnet_subnet.id
ssh_keys = var.node_ssh_keys
additional_user_data = {
"runcmd" = [
"${local.rke2_base_command} ${join(" ", formatlist("--label '%s'", local.rke2_worker_node_additional_labels))} --worker",
]
}
}
// Additional worker groups.
// Configured from var.additional_worker_groups
module "additional_worker" {
for_each = var.additional_worker_groups
source = "./modules/node-group"
cluster_id = var.cluster_id
region = var.region
role = each.key
node_count = each.value.count
node_name_suffix = local.node_name_suffix
image_slug = var.image_slug
flavor_slug = each.value.flavor
volume_size_gb = each.value.volume_size_gb != null ? each.value.volume_size_gb : var.worker_volume_size_gb
subnet_uuid = cloudscale_subnet.privnet_subnet.id
ssh_keys = var.node_ssh_keys
additional_user_data = {
"runcmd" = [
"${local.rke2_base_command} ${join(" ", formatlist("--label '%s'", local.rke2_worker_node_additional_labels))} --worker",
]
}
}