-
Notifications
You must be signed in to change notification settings - Fork 26
/
cluster-network.tf
executable file
·42 lines (38 loc) · 1.75 KB
/
cluster-network.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
resource "oci_core_volume" "nfs-cluster-network-volume" {
count = (!var.compute_cluster) && var.scratch_nfs_type_cluster == "block" && var.node_count > 0 ? 1 : 0
availability_domain = var.ad
compartment_id = var.targetCompartment
display_name = "${local.cluster_name}-nfs-volume"
size_in_gbs = var.cluster_block_volume_size
vpus_per_gb = split(".", var.cluster_block_volume_performance)[0]
}
resource "oci_core_volume_attachment" "cluster_network_volume_attachment" {
count = (!var.compute_cluster) && var.scratch_nfs_type_cluster == "block" && var.node_count > 0 ? 1 : 0
attachment_type = "iscsi"
volume_id = oci_core_volume.nfs-cluster-network-volume[0].id
instance_id = local.cluster_instances_ids[0]
display_name = "${local.cluster_name}-cluster-network-volume-attachment"
device = "/dev/oracleoci/oraclevdb"
}
resource "oci_core_cluster_network" "cluster_network" {
count = (!var.compute_cluster) && var.cluster_network && var.node_count > 0 ? 1 : 0
depends_on = [oci_core_app_catalog_subscription.mp_image_subscription, oci_core_subnet.private-subnet, oci_core_subnet.public-subnet, oci_core_instance.controller]
compartment_id = var.targetCompartment
instance_pools {
instance_configuration_id = oci_core_instance_configuration.cluster-network-instance_configuration[0].id
size = var.node_count
display_name = local.cluster_name
}
freeform_tags = {
"cluster_name" = local.cluster_name
"parent_cluster" = local.cluster_name
}
placement_configuration {
availability_domain = var.ad
primary_subnet_id = local.subnet_id
}
timeouts {
create = local.timeout_ip
}
display_name = local.cluster_name
}