-
Notifications
You must be signed in to change notification settings - Fork 0
/
worker.tf
86 lines (66 loc) · 2.51 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Default worker group.
// Configured from var.worker_{count,size,state,disk_size}
module "worker" {
source = "./modules/node-group"
cluster_id = var.cluster_id
cluster_domain = local.cluster_domain
role = "worker"
node_count = var.worker_count
region = var.region
template_id = data.exoscale_template.rhcos.id
base_domain = var.base_domain
instance_type = var.worker_type
node_state = var.worker_state
ssh_key_pair = local.ssh_key_name
root_disk_size = var.root_disk_size
data_disk_size = var.worker_data_disk_size
use_privnet = var.use_privnet
privnet_id = local.privnet_id
privnet_gw = local.privnet_gw
api_int = exoscale_domain_record.api_int.hostname
ignition_ca = var.ignition_ca
security_group_ids = concat(
var.additional_security_group_ids,
[exoscale_security_group.all_machines.id]
)
affinity_group_capacity = var.affinity_group_capacity
additional_affinity_group_ids = var.additional_affinity_group_ids
deploy_target_id = var.deploy_target_id
bootstrap_bucket = var.bootstrap_bucket
}
// 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
cluster_domain = local.cluster_domain
role = each.key
node_count = each.value.count
instance_type = each.value.type
// Default node_state to "running" if not specified in map entry
node_state = each.value.state != null ? each.value.state : "running"
root_disk_size = var.root_disk_size
// Default data disk size to 0 if map entry doesn't have field disk_size
data_disk_size = each.value.data_disk_size != null ? each.value.data_disk_size : 0
region = var.region
template_id = data.exoscale_template.rhcos.id
base_domain = var.base_domain
ssh_key_pair = local.ssh_key_name
use_privnet = var.use_privnet
privnet_id = local.privnet_id
privnet_gw = local.privnet_gw
api_int = exoscale_domain_record.api_int.hostname
ignition_ca = var.ignition_ca
security_group_ids = concat(
var.additional_security_group_ids,
[exoscale_security_group.all_machines.id]
)
affinity_group_capacity = var.affinity_group_capacity
additional_affinity_group_ids = concat(
each.value.affinity_group_ids != null ? each.value.affinity_group_ids : [],
var.additional_affinity_group_ids
)
deploy_target_id = var.deploy_target_id
bootstrap_bucket = var.bootstrap_bucket
}