46 lines
1.5 KiB
Terraform
46 lines
1.5 KiB
Terraform
|
resource "openstack_compute_instance_v2" "controller-nodes" {
|
||
|
count = var.controller_instance_count
|
||
|
name = "${var.controller_name}-${count.index}.${var.dns_suffix}"
|
||
|
flavor_name = "${var.controller_instance_type}"
|
||
|
key_pair = "${var.keyname}"
|
||
|
security_groups = ["https", "microk8s", "Allow SSH from SUNET jumphosts", "Allow ssh from the world"]
|
||
|
|
||
|
|
||
|
block_device {
|
||
|
uuid = "5d24aca9-11be-4de1-9770-4a097d68f361"
|
||
|
source_type = "image"
|
||
|
volume_size = 20
|
||
|
boot_index = 0
|
||
|
destination_type = "volume"
|
||
|
delete_on_termination = true
|
||
|
}
|
||
|
scheduler_hints {
|
||
|
group = openstack_compute_servergroup_v2.controllers.id
|
||
|
}
|
||
|
network {
|
||
|
name = "public"
|
||
|
}
|
||
|
}
|
||
|
resource "openstack_compute_instance_v2" "worker-nodes" {
|
||
|
count = var.worker_instance_count
|
||
|
name = "${var.worker_name}-${count.index}.${var.dns_suffix}"
|
||
|
flavor_name = "${var.worker_instance_type}"
|
||
|
key_pair = "${var.keyname}"
|
||
|
security_groups = ["microk8s", "Allow SSH from SUNET jumphosts", "Allow ssh from the world"]
|
||
|
|
||
|
block_device {
|
||
|
uuid = "5d24aca9-11be-4de1-9770-4a097d68f361"
|
||
|
source_type = "image"
|
||
|
volume_size = 20
|
||
|
boot_index = 0
|
||
|
destination_type = "volume"
|
||
|
delete_on_termination = true
|
||
|
}
|
||
|
scheduler_hints {
|
||
|
group = openstack_compute_servergroup_v2.workers.id
|
||
|
}
|
||
|
network {
|
||
|
name = "public"
|
||
|
}
|
||
|
}
|