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.

155 lines
7.9 KiB

  1. module "network" {
  2. source = "./modules/network"
  3. external_net = var.external_net
  4. network_name = var.network_name
  5. subnet_cidr = var.subnet_cidr
  6. cluster_name = var.cluster_name
  7. dns_nameservers = var.dns_nameservers
  8. network_dns_domain = var.network_dns_domain
  9. use_neutron = var.use_neutron
  10. port_security_enabled = var.port_security_enabled
  11. router_id = var.router_id
  12. }
  13. module "ips" {
  14. source = "./modules/ips"
  15. number_of_k8s_masters = var.number_of_k8s_masters
  16. number_of_k8s_masters_no_etcd = var.number_of_k8s_masters_no_etcd
  17. number_of_k8s_nodes = var.number_of_k8s_nodes
  18. floatingip_pool = var.floatingip_pool
  19. number_of_bastions = var.number_of_bastions
  20. external_net = var.external_net
  21. network_name = var.network_name
  22. router_id = module.network.router_id
  23. k8s_nodes = var.k8s_nodes
  24. k8s_masters = var.k8s_masters
  25. k8s_master_fips = var.k8s_master_fips
  26. bastion_fips = var.bastion_fips
  27. router_internal_port_id = module.network.router_internal_port_id
  28. }
  29. module "compute" {
  30. source = "./modules/compute"
  31. cluster_name = var.cluster_name
  32. az_list = var.az_list
  33. az_list_node = var.az_list_node
  34. number_of_k8s_masters = var.number_of_k8s_masters
  35. number_of_k8s_masters_no_etcd = var.number_of_k8s_masters_no_etcd
  36. number_of_etcd = var.number_of_etcd
  37. number_of_k8s_masters_no_floating_ip = var.number_of_k8s_masters_no_floating_ip
  38. number_of_k8s_masters_no_floating_ip_no_etcd = var.number_of_k8s_masters_no_floating_ip_no_etcd
  39. number_of_k8s_nodes = var.number_of_k8s_nodes
  40. number_of_bastions = var.number_of_bastions
  41. number_of_k8s_nodes_no_floating_ip = var.number_of_k8s_nodes_no_floating_ip
  42. number_of_gfs_nodes_no_floating_ip = var.number_of_gfs_nodes_no_floating_ip
  43. k8s_masters = var.k8s_masters
  44. k8s_nodes = var.k8s_nodes
  45. bastion_root_volume_size_in_gb = var.bastion_root_volume_size_in_gb
  46. etcd_root_volume_size_in_gb = var.etcd_root_volume_size_in_gb
  47. master_root_volume_size_in_gb = var.master_root_volume_size_in_gb
  48. node_root_volume_size_in_gb = var.node_root_volume_size_in_gb
  49. gfs_root_volume_size_in_gb = var.gfs_root_volume_size_in_gb
  50. gfs_volume_size_in_gb = var.gfs_volume_size_in_gb
  51. master_volume_type = var.master_volume_type
  52. node_volume_type = var.node_volume_type
  53. public_key_path = var.public_key_path
  54. image = var.image
  55. image_uuid = var.image_uuid
  56. image_gfs = var.image_gfs
  57. image_master = var.image_master
  58. image_master_uuid = var.image_master_uuid
  59. image_gfs_uuid = var.image_gfs_uuid
  60. ssh_user = var.ssh_user
  61. ssh_user_gfs = var.ssh_user_gfs
  62. flavor_k8s_master = var.flavor_k8s_master
  63. flavor_k8s_node = var.flavor_k8s_node
  64. flavor_etcd = var.flavor_etcd
  65. flavor_gfs_node = var.flavor_gfs_node
  66. network_name = var.network_name
  67. flavor_bastion = var.flavor_bastion
  68. k8s_master_fips = module.ips.k8s_master_fips
  69. k8s_master_no_etcd_fips = module.ips.k8s_master_no_etcd_fips
  70. k8s_masters_fips = module.ips.k8s_masters_fips
  71. k8s_node_fips = module.ips.k8s_node_fips
  72. k8s_nodes_fips = module.ips.k8s_nodes_fips
  73. bastion_fips = module.ips.bastion_fips
  74. bastion_allowed_remote_ips = var.bastion_allowed_remote_ips
  75. bastion_allowed_remote_ipv6_ips = var.bastion_allowed_remote_ipv6_ips
  76. master_allowed_remote_ips = var.master_allowed_remote_ips
  77. master_allowed_remote_ipv6_ips = var.master_allowed_remote_ipv6_ips
  78. k8s_allowed_remote_ips = var.k8s_allowed_remote_ips
  79. k8s_allowed_remote_ips_ipv6 = var.k8s_allowed_remote_ips_ipv6
  80. k8s_allowed_egress_ips = var.k8s_allowed_egress_ips
  81. k8s_allowed_egress_ipv6_ips = var.k8s_allowed_egress_ipv6_ips
  82. supplementary_master_groups = var.supplementary_master_groups
  83. supplementary_node_groups = var.supplementary_node_groups
  84. master_allowed_ports = var.master_allowed_ports
  85. master_allowed_ports_ipv6 = var.master_allowed_ports_ipv6
  86. worker_allowed_ports = var.worker_allowed_ports
  87. worker_allowed_ports_ipv6 = var.worker_allowed_ports_ipv6
  88. bastion_allowed_ports = var.bastion_allowed_ports
  89. bastion_allowed_ports_ipv6 = var.bastion_allowed_ports_ipv6
  90. use_access_ip = var.use_access_ip
  91. master_server_group_policy = var.master_server_group_policy
  92. node_server_group_policy = var.node_server_group_policy
  93. etcd_server_group_policy = var.etcd_server_group_policy
  94. extra_sec_groups = var.extra_sec_groups
  95. extra_sec_groups_name = var.extra_sec_groups_name
  96. group_vars_path = var.group_vars_path
  97. port_security_enabled = var.port_security_enabled
  98. force_null_port_security = var.force_null_port_security
  99. network_router_id = module.network.router_id
  100. network_id = module.network.network_id
  101. use_existing_network = var.use_existing_network
  102. private_subnet_id = module.network.subnet_id
  103. additional_server_groups = var.additional_server_groups
  104. depends_on = [
  105. module.network.subnet_id
  106. ]
  107. }
  108. module "loadbalancer" {
  109. source = "./modules/loadbalancer"
  110. cluster_name = var.cluster_name
  111. subnet_id = module.network.subnet_id
  112. floatingip_pool = var.floatingip_pool
  113. k8s_master_ips = module.compute.k8s_master_ips
  114. k8s_master_loadbalancer_enabled = var.k8s_master_loadbalancer_enabled
  115. k8s_master_loadbalancer_listener_port = var.k8s_master_loadbalancer_listener_port
  116. k8s_master_loadbalancer_server_port = var.k8s_master_loadbalancer_server_port
  117. k8s_master_loadbalancer_public_ip = var.k8s_master_loadbalancer_public_ip
  118. depends_on = [
  119. module.compute.k8s_master
  120. ]
  121. }
  122. output "private_subnet_id" {
  123. value = module.network.subnet_id
  124. }
  125. output "floating_network_id" {
  126. value = var.external_net
  127. }
  128. output "router_id" {
  129. value = module.network.router_id
  130. }
  131. output "k8s_master_fips" {
  132. value = var.number_of_k8s_masters + var.number_of_k8s_masters_no_etcd > 0 ? concat(module.ips.k8s_master_fips, module.ips.k8s_master_no_etcd_fips) : [for key, value in module.ips.k8s_masters_fips : value.address]
  133. }
  134. output "k8s_node_fips" {
  135. value = var.number_of_k8s_nodes > 0 ? module.ips.k8s_node_fips : [for key, value in module.ips.k8s_nodes_fips : value.address]
  136. }
  137. output "bastion_fips" {
  138. value = module.ips.bastion_fips
  139. }