diff --git a/contrib/terraform/openstack/modules/compute/despegar.tf b/contrib/terraform/openstack/modules/compute/despegar.tf index b1ca1240c72..6b7329fece6 100644 --- a/contrib/terraform/openstack/modules/compute/despegar.tf +++ b/contrib/terraform/openstack/modules/compute/despegar.tf @@ -4,14 +4,14 @@ # https://github.com/projectcalico/calico/issues/1604 # https://github.com/projectcalico/calico/issues/3365#issuecomment-660202663 resource "openstack_networking_secgroup_rule_v2" "master_tcp" { - security_group_id = "${openstack_networking_secgroup_v2.k8s_master.id}" - count = "${length(var.worker_allowed_ports)}" + security_group_id = openstack_networking_secgroup_v2.k8s_master.id + count = length(var.worker_allowed_ports) direction = "ingress" ethertype = "IPv4" - protocol = "${lookup(var.worker_allowed_ports[count.index], "protocol", "tcp")}" - port_range_min = "${lookup(var.worker_allowed_ports[count.index], "port_range_min")}" - port_range_max = "${lookup(var.worker_allowed_ports[count.index], "port_range_max")}" - remote_ip_prefix = "${lookup(var.worker_allowed_ports[count.index], "remote_ip_prefix", "0.0.0.0/0")}" + protocol = lookup(var.worker_allowed_ports[count.index], "protocol", "tcp") + port_range_min = lookup(var.worker_allowed_ports[count.index], "port_range_min") + port_range_max = lookup(var.worker_allowed_ports[count.index], "port_range_max") + remote_ip_prefix = lookup(var.worker_allowed_ports[count.index], "remote_ip_prefix", "0.0.0.0/0") } data "template_file" "user_data" { @@ -24,53 +24,53 @@ data "template_file" "user_data" { # allow ping resource "openstack_networking_secgroup_rule_v2" "k8s_icmp_i" { - count = "${length(var.k8s_allowed_remote_ips)}" + count = length(var.k8s_allowed_remote_ips) direction = "ingress" ethertype = "IPv4" protocol = "icmp" - remote_ip_prefix = "${var.k8s_allowed_remote_ips[count.index]}" - security_group_id = "${openstack_networking_secgroup_v2.k8s.id}" + remote_ip_prefix = var.k8s_allowed_remote_ips[count.index] + security_group_id = openstack_networking_secgroup_v2.k8s.id } resource "openstack_networking_secgroup_rule_v2" "k8s_icmp_e" { - count = "${length(var.k8s_allowed_remote_ips)}" + count = length(var.k8s_allowed_remote_ips) direction = "egress" ethertype = "IPv4" protocol = "icmp" - remote_ip_prefix = "${var.k8s_allowed_remote_ips[count.index]}" - security_group_id = "${openstack_networking_secgroup_v2.k8s.id}" + remote_ip_prefix = var.k8s_allowed_remote_ips[count.index] + security_group_id = openstack_networking_secgroup_v2.k8s.id } # allow SNMP resource "openstack_networking_secgroup_rule_v2" "k8s_snmp" { - count = "${length(var.k8s_allowed_remote_ips)}" + count = length(var.k8s_allowed_remote_ips) direction = "ingress" ethertype = "IPv4" protocol = "udp" port_range_min = 161 port_range_max = 161 - remote_ip_prefix = "${var.k8s_allowed_remote_ips[count.index]}" - security_group_id = "${openstack_networking_secgroup_v2.k8s.id}" + remote_ip_prefix = var.k8s_allowed_remote_ips[count.index] + security_group_id = openstack_networking_secgroup_v2.k8s.id } # allow NTP from nagios resource "openstack_networking_secgroup_rule_v2" "k8s_ntp" { - count = "${length(var.k8s_allowed_remote_ips)}" + count = length(var.k8s_allowed_remote_ips) direction = "ingress" ethertype = "IPv4" protocol = "udp" port_range_min = 123 port_range_max = 123 - remote_ip_prefix = "${var.k8s_allowed_remote_ips[count.index]}" - security_group_id = "${openstack_networking_secgroup_v2.k8s.id}" + remote_ip_prefix = var.k8s_allowed_remote_ips[count.index] + security_group_id = openstack_networking_secgroup_v2.k8s.id } resource "openstack_networking_secgroup_rule_v2" "k8s_ntp_e" { - count = "${length(var.k8s_allowed_remote_ips)}" + count = length(var.k8s_allowed_remote_ips) direction = "egress" ethertype = "IPv4" protocol = "udp" port_range_min = 123 port_range_max = 123 - remote_ip_prefix = "${var.k8s_allowed_remote_ips[count.index]}" - security_group_id = "${openstack_networking_secgroup_v2.k8s.id}" + remote_ip_prefix = var.k8s_allowed_remote_ips[count.index] + security_group_id = openstack_networking_secgroup_v2.k8s.id } diff --git a/contrib/terraform/openstack/modules/compute/despegar_masters.tf b/contrib/terraform/openstack/modules/compute/despegar_masters.tf index 52354e98f51..df4f778c74d 100644 --- a/contrib/terraform/openstack/modules/compute/despegar_masters.tf +++ b/contrib/terraform/openstack/modules/compute/despegar_masters.tf @@ -1,191 +1,191 @@ module "master_node1" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[0]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[0]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[0]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[0]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[0]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[0]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node2" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[1]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[1]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[1]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[1]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[1]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[1]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node3" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[2]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[2]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[2]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[2]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[2]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[2]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node4" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[3]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[3]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[3]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[3]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[3]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[3]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node5" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[4]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[4]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[4]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[4]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[4]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[4]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node6" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[5]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[5]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[5]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[5]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[5]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[5]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node7" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[6]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[6]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[6]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[6]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[6]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[6]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "master_node8" { source = "./despegar_masters" - master_index = "${var.despegar_k8s_masters[7]["index"]}" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_masters = "${var.despegar_k8s_masters[7]["q"]}" - master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_master = "${var.despegar_k8s_masters[7]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.k8s_master.name}" ] - supplementary_master_groups = "${var.supplementary_master_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + master_index = var.despegar_k8s_masters[7]["index"] + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_masters = var.despegar_k8s_masters[7]["q"] + master_root_volume_size_in_gb = var.master_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_master = var.despegar_k8s_masters[7]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.k8s_master.name ] + supplementary_master_groups = var.supplementary_master_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } diff --git a/contrib/terraform/openstack/modules/compute/despegar_nodes.tf b/contrib/terraform/openstack/modules/compute/despegar_nodes.tf index 76a7834fb01..44699dc1586 100644 --- a/contrib/terraform/openstack/modules/compute/despegar_nodes.tf +++ b/contrib/terraform/openstack/modules/compute/despegar_nodes.tf @@ -2,238 +2,238 @@ module "nodes_type1" { source = "./despegar_nodes" node_type = "t01" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[0]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[0]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[0]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[0]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type2" { source = "./despegar_nodes" node_type = "t02" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[1]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[1]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[1]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[1]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type3" { source = "./despegar_nodes" node_type = "t03" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[2]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[2]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[2]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[2]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type4" { source = "./despegar_nodes" node_type = "t04" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[3]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[3]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[3]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[3]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type5" { source = "./despegar_nodes" node_type = "t05" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[4]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[4]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[4]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[4]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type6" { source = "./despegar_nodes" node_type = "t06" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[5]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[5]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[5]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[5]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type7" { source = "./despegar_nodes" node_type = "t07" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[6]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[6]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[6]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[6]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type8" { source = "./despegar_nodes" node_type = "t08" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[7]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[7]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[7]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[7]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type9" { source = "./despegar_nodes" node_type = "t09" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[8]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[8]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[8]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[8]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } module "nodes_type10" { source = "./despegar_nodes" node_type = "t10" - cluster_name = "${var.cluster_name}" - az_list = "${var.az_list}" - az_list_node = "${var.az_list_node}" - number_of_k8s_nodes = "${var.despegar_k8s_nodes[9]["q"]}" - node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}" - image = "${var.image}" - ssh_user = "${var.ssh_user}" - flavor_k8s_node = "${var.despegar_k8s_nodes[9]["flavor"]}" - network_name = "${var.network_name}" - network_id = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - key_pair = "${openstack_compute_keypair_v2.k8s.name}" - secgroups = ["${openstack_networking_secgroup_v2.k8s.name}", "${openstack_networking_secgroup_v2.worker.name}"] - supplementary_node_groups = "${var.supplementary_node_groups}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" - dns_zone = "${var.dns_zone}" - cluster_domain = "${var.cluster_domain}" + cluster_name = var.cluster_name + az_list = var.az_list + az_list_node = var.az_list_node + number_of_k8s_nodes = var.despegar_k8s_nodes[9]["q"] + node_root_volume_size_in_gb = var.node_root_volume_size_in_gb + image = var.image + ssh_user = var.ssh_user + flavor_k8s_node = var.despegar_k8s_nodes[9]["flavor"] + network_name = var.network_name + network_id = var.network_id + use_access_ip = var.use_access_ip + key_pair = openstack_compute_keypair_v2.k8s.name + secgroups = [openstack_networking_secgroup_v2.k8s.name, openstack_networking_secgroup_v2.worker.name] + supplementary_node_groups = var.supplementary_node_groups + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet + dns_zone = var.dns_zone + cluster_domain = var.cluster_domain } diff --git a/contrib/terraform/openstack/modules/compute/despegar_nodes/main.tf b/contrib/terraform/openstack/modules/compute/despegar_nodes/main.tf index c9c7fb700ff..a95efdc8516 100644 --- a/contrib/terraform/openstack/modules/compute/despegar_nodes/main.tf +++ b/contrib/terraform/openstack/modules/compute/despegar_nodes/main.tf @@ -1,6 +1,6 @@ resource "null_resource" "dns_updater_probe" { triggers = { - always_run = "${timestamp()}" + always_run = timestamp() } provisioner "local-exec" { command = < 0 ? [var.image] : [] content { - uuid = "${data.openstack_images_image_v2.vm_image.id}" + uuid = data.openstack_images_image_v2.vm_image.id source_type = "image" - volume_size = "${var.node_root_volume_size_in_gb}" + volume_size = var.node_root_volume_size_in_gb boot_index = 0 destination_type = "volume" delete_on_termination = true @@ -53,7 +53,7 @@ resource "openstack_compute_instance_v2" "k8s_despegar_node" { } network { - name = "${var.network_name}" + name = var.network_name } security_groups = var.secgroups @@ -64,12 +64,12 @@ resource "openstack_compute_instance_v2" "k8s_despegar_node" { } metadata = { - ssh_user = "${var.ssh_user}" + ssh_user = var.ssh_user kubespray_groups = "kube-node,k8s-cluster,no-floating,${var.supplementary_node_groups}" - depends_on = "${var.network_id}" - use_access_ip = "${var.use_access_ip}" - kube_service_addresses = "${var.kube_service_addresses}" - kube_pods_subnet = "${var.kube_pods_subnet}" + depends_on = var.network_id + use_access_ip = var.use_access_ip + kube_service_addresses = var.kube_service_addresses + kube_pods_subnet = var.kube_pods_subnet } provisioner "local-exec" {