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.

108 lines
5.0 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. master_volume_type = var.master_volume_type
  49. public_key_path = var.public_key_path
  50. image = var.image
  51. image_gfs = var.image_gfs
  52. ssh_user = var.ssh_user
  53. ssh_user_gfs = var.ssh_user_gfs
  54. flavor_k8s_master = var.flavor_k8s_master
  55. flavor_k8s_node = var.flavor_k8s_node
  56. flavor_etcd = var.flavor_etcd
  57. flavor_gfs_node = var.flavor_gfs_node
  58. network_name = var.network_name
  59. flavor_bastion = var.flavor_bastion
  60. k8s_master_fips = module.ips.k8s_master_fips
  61. k8s_master_no_etcd_fips = module.ips.k8s_master_no_etcd_fips
  62. k8s_node_fips = module.ips.k8s_node_fips
  63. k8s_nodes_fips = module.ips.k8s_nodes_fips
  64. bastion_fips = module.ips.bastion_fips
  65. bastion_allowed_remote_ips = var.bastion_allowed_remote_ips
  66. master_allowed_remote_ips = var.master_allowed_remote_ips
  67. k8s_allowed_remote_ips = var.k8s_allowed_remote_ips
  68. k8s_allowed_egress_ips = var.k8s_allowed_egress_ips
  69. supplementary_master_groups = var.supplementary_master_groups
  70. supplementary_node_groups = var.supplementary_node_groups
  71. master_allowed_ports = var.master_allowed_ports
  72. worker_allowed_ports = var.worker_allowed_ports
  73. wait_for_floatingip = var.wait_for_floatingip
  74. use_access_ip = var.use_access_ip
  75. use_server_groups = var.use_server_groups
  76. network_id = module.network.router_id
  77. }
  78. output "private_subnet_id" {
  79. value = module.network.subnet_id
  80. }
  81. output "floating_network_id" {
  82. value = var.external_net
  83. }
  84. output "router_id" {
  85. value = module.network.router_id
  86. }
  87. output "k8s_master_fips" {
  88. value = concat(module.ips.k8s_master_fips, module.ips.k8s_master_no_etcd_fips)
  89. }
  90. output "k8s_node_fips" {
  91. value = var.number_of_k8s_nodes > 0 ? module.ips.k8s_node_fips : [for key, value in module.ips.k8s_nodes_fips : value.address]
  92. }
  93. output "bastion_fips" {
  94. value = module.ips.bastion_fips
  95. }