You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
4.8 KiB

  1. provider "openstack" {
  2. version = "~> 1.17"
  3. }
  4. module "network" {
  5. source = "./modules/network"
  6. external_net = var.external_net
  7. network_name = var.network_name
  8. subnet_cidr = var.subnet_cidr
  9. cluster_name = var.cluster_name
  10. dns_nameservers = var.dns_nameservers
  11. network_dns_domain = var.network_dns_domain
  12. use_neutron = var.use_neutron
  13. router_id = var.router_id
  14. }
  15. module "ips" {
  16. source = "./modules/ips"
  17. number_of_k8s_masters = var.number_of_k8s_masters
  18. number_of_k8s_masters_no_etcd = var.number_of_k8s_masters_no_etcd
  19. number_of_k8s_nodes = var.number_of_k8s_nodes
  20. floatingip_pool = var.floatingip_pool
  21. number_of_bastions = var.number_of_bastions
  22. external_net = var.external_net
  23. network_name = var.network_name
  24. router_id = module.network.router_id
  25. k8s_nodes = var.k8s_nodes
  26. }
  27. module "compute" {
  28. source = "./modules/compute"
  29. cluster_name = var.cluster_name
  30. az_list = var.az_list
  31. az_list_node = var.az_list_node
  32. number_of_k8s_masters = var.number_of_k8s_masters
  33. number_of_k8s_masters_no_etcd = var.number_of_k8s_masters_no_etcd
  34. number_of_etcd = var.number_of_etcd
  35. number_of_k8s_masters_no_floating_ip = var.number_of_k8s_masters_no_floating_ip
  36. number_of_k8s_masters_no_floating_ip_no_etcd = var.number_of_k8s_masters_no_floating_ip_no_etcd
  37. number_of_k8s_nodes = var.number_of_k8s_nodes
  38. number_of_bastions = var.number_of_bastions
  39. number_of_k8s_nodes_no_floating_ip = var.number_of_k8s_nodes_no_floating_ip
  40. number_of_gfs_nodes_no_floating_ip = var.number_of_gfs_nodes_no_floating_ip
  41. k8s_nodes = var.k8s_nodes
  42. bastion_root_volume_size_in_gb = var.bastion_root_volume_size_in_gb
  43. etcd_root_volume_size_in_gb = var.etcd_root_volume_size_in_gb
  44. master_root_volume_size_in_gb = var.master_root_volume_size_in_gb
  45. node_root_volume_size_in_gb = var.node_root_volume_size_in_gb
  46. gfs_root_volume_size_in_gb = var.gfs_root_volume_size_in_gb
  47. gfs_volume_size_in_gb = var.gfs_volume_size_in_gb
  48. public_key_path = var.public_key_path
  49. image = var.image
  50. image_gfs = var.image_gfs
  51. ssh_user = var.ssh_user
  52. ssh_user_gfs = var.ssh_user_gfs
  53. flavor_k8s_master = var.flavor_k8s_master
  54. flavor_k8s_node = var.flavor_k8s_node
  55. flavor_etcd = var.flavor_etcd
  56. flavor_gfs_node = var.flavor_gfs_node
  57. network_name = var.network_name
  58. flavor_bastion = var.flavor_bastion
  59. k8s_master_fips = module.ips.k8s_master_fips
  60. k8s_master_no_etcd_fips = module.ips.k8s_master_no_etcd_fips
  61. k8s_node_fips = module.ips.k8s_node_fips
  62. k8s_nodes_fips = module.ips.k8s_nodes_fips
  63. bastion_fips = module.ips.bastion_fips
  64. bastion_allowed_remote_ips = var.bastion_allowed_remote_ips
  65. master_allowed_remote_ips = var.master_allowed_remote_ips
  66. k8s_allowed_remote_ips = var.k8s_allowed_remote_ips
  67. k8s_allowed_egress_ips = var.k8s_allowed_egress_ips
  68. supplementary_master_groups = var.supplementary_master_groups
  69. supplementary_node_groups = var.supplementary_node_groups
  70. worker_allowed_ports = var.worker_allowed_ports
  71. wait_for_floatingip = var.wait_for_floatingip
  72. use_access_ip = var.use_access_ip
  73. use_server_groups = var.use_server_groups
  74. network_id = module.network.router_id
  75. }
  76. output "private_subnet_id" {
  77. value = module.network.subnet_id
  78. }
  79. output "floating_network_id" {
  80. value = var.external_net
  81. }
  82. output "router_id" {
  83. value = module.network.router_id
  84. }
  85. output "k8s_master_fips" {
  86. value = concat(module.ips.k8s_master_fips, module.ips.k8s_master_no_etcd_fips)
  87. }
  88. output "k8s_node_fips" {
  89. value = var.number_of_k8s_nodes > 0 ? module.ips.k8s_node_fips : [for key, value in module.ips.k8s_nodes_fips : value.address]
  90. }
  91. output "bastion_fips" {
  92. value = module.ips.bastion_fips
  93. }