2019-04-24 13:22:01 +08:00
|
|
|
provider "openstack" {
|
|
|
|
version = "~> 1.17"
|
|
|
|
}
|
|
|
|
|
2017-12-05 20:48:47 +08:00
|
|
|
module "network" {
|
2019-08-18 16:30:05 +08:00
|
|
|
source = "./modules/network"
|
2017-12-05 20:48:47 +08:00
|
|
|
|
2019-08-21 20:09:15 +08:00
|
|
|
external_net = "${var.external_net}"
|
|
|
|
network_name = "${var.network_name}"
|
|
|
|
subnet_cidr = "${var.subnet_cidr}"
|
|
|
|
cluster_name = "${var.cluster_name}"
|
|
|
|
dns_nameservers = "${var.dns_nameservers}"
|
|
|
|
network_dns_domain = "${var.network_dns_domain}"
|
|
|
|
use_neutron = "${var.use_neutron}"
|
2020-04-06 17:41:46 +08:00
|
|
|
router_id = "${var.router_id}"
|
2017-12-05 20:48:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module "ips" {
|
2019-08-18 16:30:05 +08:00
|
|
|
source = "./modules/ips"
|
2017-12-05 20:48:47 +08:00
|
|
|
|
2018-01-05 19:09:04 +08:00
|
|
|
number_of_k8s_masters = "${var.number_of_k8s_masters}"
|
2017-12-05 20:48:47 +08:00
|
|
|
number_of_k8s_masters_no_etcd = "${var.number_of_k8s_masters_no_etcd}"
|
2018-01-05 19:09:04 +08:00
|
|
|
number_of_k8s_nodes = "${var.number_of_k8s_nodes}"
|
|
|
|
floatingip_pool = "${var.floatingip_pool}"
|
|
|
|
number_of_bastions = "${var.number_of_bastions}"
|
|
|
|
external_net = "${var.external_net}"
|
|
|
|
network_name = "${var.network_name}"
|
|
|
|
router_id = "${module.network.router_id}"
|
2017-12-05 20:48:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module "compute" {
|
2019-08-18 16:30:05 +08:00
|
|
|
source = "./modules/compute"
|
2017-12-05 20:48:47 +08:00
|
|
|
|
2018-01-05 19:09:04 +08:00
|
|
|
cluster_name = "${var.cluster_name}"
|
2018-07-31 17:18:27 +08:00
|
|
|
az_list = "${var.az_list}"
|
2020-02-18 20:29:27 +08:00
|
|
|
az_list_node = "${var.az_list_node}"
|
2018-01-05 19:09:04 +08:00
|
|
|
number_of_k8s_masters = "${var.number_of_k8s_masters}"
|
|
|
|
number_of_k8s_masters_no_etcd = "${var.number_of_k8s_masters_no_etcd}"
|
|
|
|
number_of_etcd = "${var.number_of_etcd}"
|
|
|
|
number_of_k8s_masters_no_floating_ip = "${var.number_of_k8s_masters_no_floating_ip}"
|
2017-12-05 20:48:47 +08:00
|
|
|
number_of_k8s_masters_no_floating_ip_no_etcd = "${var.number_of_k8s_masters_no_floating_ip_no_etcd}"
|
2018-01-05 19:09:04 +08:00
|
|
|
number_of_k8s_nodes = "${var.number_of_k8s_nodes}"
|
|
|
|
number_of_bastions = "${var.number_of_bastions}"
|
|
|
|
number_of_k8s_nodes_no_floating_ip = "${var.number_of_k8s_nodes_no_floating_ip}"
|
|
|
|
number_of_gfs_nodes_no_floating_ip = "${var.number_of_gfs_nodes_no_floating_ip}"
|
2019-09-25 20:17:59 +08:00
|
|
|
bastion_root_volume_size_in_gb = "${var.bastion_root_volume_size_in_gb}"
|
|
|
|
etcd_root_volume_size_in_gb = "${var.etcd_root_volume_size_in_gb}"
|
|
|
|
master_root_volume_size_in_gb = "${var.master_root_volume_size_in_gb}"
|
|
|
|
node_root_volume_size_in_gb = "${var.node_root_volume_size_in_gb}"
|
|
|
|
gfs_root_volume_size_in_gb = "${var.gfs_root_volume_size_in_gb}"
|
2018-01-05 19:09:04 +08:00
|
|
|
gfs_volume_size_in_gb = "${var.gfs_volume_size_in_gb}"
|
|
|
|
public_key_path = "${var.public_key_path}"
|
|
|
|
image = "${var.image}"
|
|
|
|
image_gfs = "${var.image_gfs}"
|
|
|
|
ssh_user = "${var.ssh_user}"
|
|
|
|
ssh_user_gfs = "${var.ssh_user_gfs}"
|
|
|
|
flavor_k8s_master = "${var.flavor_k8s_master}"
|
|
|
|
flavor_k8s_node = "${var.flavor_k8s_node}"
|
|
|
|
flavor_etcd = "${var.flavor_etcd}"
|
|
|
|
flavor_gfs_node = "${var.flavor_gfs_node}"
|
|
|
|
network_name = "${var.network_name}"
|
|
|
|
flavor_bastion = "${var.flavor_bastion}"
|
|
|
|
k8s_master_fips = "${module.ips.k8s_master_fips}"
|
2019-04-29 13:58:20 +08:00
|
|
|
k8s_master_no_etcd_fips = "${module.ips.k8s_master_no_etcd_fips}"
|
2018-01-05 19:09:04 +08:00
|
|
|
k8s_node_fips = "${module.ips.k8s_node_fips}"
|
|
|
|
bastion_fips = "${module.ips.bastion_fips}"
|
2018-09-28 17:35:02 +08:00
|
|
|
bastion_allowed_remote_ips = "${var.bastion_allowed_remote_ips}"
|
2019-04-21 16:57:44 +08:00
|
|
|
master_allowed_remote_ips = "${var.master_allowed_remote_ips}"
|
2019-04-15 22:22:08 +08:00
|
|
|
k8s_allowed_remote_ips = "${var.k8s_allowed_remote_ips}"
|
2019-04-17 17:10:03 +08:00
|
|
|
k8s_allowed_egress_ips = "${var.k8s_allowed_egress_ips}"
|
2018-04-30 23:11:07 +08:00
|
|
|
supplementary_master_groups = "${var.supplementary_master_groups}"
|
2018-06-28 22:32:59 +08:00
|
|
|
supplementary_node_groups = "${var.supplementary_node_groups}"
|
2018-10-31 19:09:22 +08:00
|
|
|
worker_allowed_ports = "${var.worker_allowed_ports}"
|
2019-05-09 17:16:50 +08:00
|
|
|
wait_for_floatingip = "${var.wait_for_floatingip}"
|
2019-10-07 19:09:09 +08:00
|
|
|
use_access_ip = "${var.use_access_ip}"
|
2019-12-09 17:15:10 +08:00
|
|
|
use_server_groups = "${var.use_server_groups}"
|
2017-12-05 20:48:47 +08:00
|
|
|
|
|
|
|
network_id = "${module.network.router_id}"
|
2016-10-26 22:56:15 +08:00
|
|
|
}
|
2017-12-06 22:58:40 +08:00
|
|
|
|
|
|
|
output "private_subnet_id" {
|
|
|
|
value = "${module.network.subnet_id}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "floating_network_id" {
|
|
|
|
value = "${var.external_net}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "router_id" {
|
|
|
|
value = "${module.network.router_id}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "k8s_master_fips" {
|
2019-04-29 13:58:20 +08:00
|
|
|
value = "${concat(module.ips.k8s_master_fips, module.ips.k8s_master_no_etcd_fips)}"
|
2017-12-06 22:58:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
output "k8s_node_fips" {
|
|
|
|
value = "${module.ips.k8s_node_fips}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "bastion_fips" {
|
|
|
|
value = "${module.ips.bastion_fips}"
|
|
|
|
}
|