Add support for router less deployments
This commit is contained in:
parent
a48131f1e1
commit
38beab8fe8
8 changed files with 24 additions and 7 deletions
|
@ -16,13 +16,13 @@ most modern installs of OpenStack that support the basic services.
|
||||||
- [ElastX](https://elastx.se/)
|
- [ElastX](https://elastx.se/)
|
||||||
- [EnterCloudSuite](https://www.entercloudsuite.com/)
|
- [EnterCloudSuite](https://www.entercloudsuite.com/)
|
||||||
- [FugaCloud](https://fuga.cloud/)
|
- [FugaCloud](https://fuga.cloud/)
|
||||||
|
- [OVH](https://www.ovh.com/)
|
||||||
|
- [Rackspace](https://www.rackspace.com/)
|
||||||
- [Ultimum](https://ultimum.io/)
|
- [Ultimum](https://ultimum.io/)
|
||||||
- [VexxHost](https://vexxhost.com/)
|
- [VexxHost](https://vexxhost.com/)
|
||||||
- [Zetta](https://www.zetta.io/)
|
- [Zetta](https://www.zetta.io/)
|
||||||
|
|
||||||
### Known incompatible public clouds
|
### Known incompatible public clouds
|
||||||
- OVH: No router support
|
|
||||||
- Rackspace: No router support
|
|
||||||
- T-Systems / Open Telekom Cloud: requires `wait_until_associated`
|
- T-Systems / Open Telekom Cloud: requires `wait_until_associated`
|
||||||
|
|
||||||
## Approach
|
## Approach
|
||||||
|
|
|
@ -6,6 +6,7 @@ module "network" {
|
||||||
subnet_cidr = "${var.subnet_cidr}"
|
subnet_cidr = "${var.subnet_cidr}"
|
||||||
cluster_name = "${var.cluster_name}"
|
cluster_name = "${var.cluster_name}"
|
||||||
dns_nameservers = "${var.dns_nameservers}"
|
dns_nameservers = "${var.dns_nameservers}"
|
||||||
|
use_neutron = "${var.use_neutron}"
|
||||||
}
|
}
|
||||||
|
|
||||||
module "ips" {
|
module "ips" {
|
||||||
|
|
|
@ -46,7 +46,9 @@ variable "network_name" {}
|
||||||
|
|
||||||
variable "flavor_bastion" {}
|
variable "flavor_bastion" {}
|
||||||
|
|
||||||
variable "network_id" {}
|
variable "network_id" {
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "k8s_master_fips" {
|
variable "k8s_master_fips" {
|
||||||
type = "list"
|
type = "list"
|
||||||
|
|
|
@ -12,4 +12,6 @@ variable "external_net" {}
|
||||||
|
|
||||||
variable "network_name" {}
|
variable "network_name" {}
|
||||||
|
|
||||||
variable "router_id" {}
|
variable "router_id" {
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
resource "openstack_networking_router_v2" "k8s" {
|
resource "openstack_networking_router_v2" "k8s" {
|
||||||
name = "${var.cluster_name}-router"
|
name = "${var.cluster_name}-router"
|
||||||
|
count = "${var.use_neutron}"
|
||||||
admin_state_up = "true"
|
admin_state_up = "true"
|
||||||
external_network_id = "${var.external_net}"
|
external_network_id = "${var.external_net}"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_network_v2" "k8s" {
|
resource "openstack_networking_network_v2" "k8s" {
|
||||||
name = "${var.network_name}"
|
name = "${var.network_name}"
|
||||||
|
count = "${var.use_neutron}"
|
||||||
admin_state_up = "true"
|
admin_state_up = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_subnet_v2" "k8s" {
|
resource "openstack_networking_subnet_v2" "k8s" {
|
||||||
name = "${var.cluster_name}-internal-network"
|
name = "${var.cluster_name}-internal-network"
|
||||||
|
count = "${var.use_neutron}"
|
||||||
network_id = "${openstack_networking_network_v2.k8s.id}"
|
network_id = "${openstack_networking_network_v2.k8s.id}"
|
||||||
cidr = "${var.subnet_cidr}"
|
cidr = "${var.subnet_cidr}"
|
||||||
ip_version = 4
|
ip_version = 4
|
||||||
|
@ -18,6 +21,7 @@ resource "openstack_networking_subnet_v2" "k8s" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_networking_router_interface_v2" "k8s" {
|
resource "openstack_networking_router_interface_v2" "k8s" {
|
||||||
|
count = "${var.use_neutron}"
|
||||||
router_id = "${openstack_networking_router_v2.k8s.id}"
|
router_id = "${openstack_networking_router_v2.k8s.id}"
|
||||||
subnet_id = "${openstack_networking_subnet_v2.k8s.id}"
|
subnet_id = "${openstack_networking_subnet_v2.k8s.id}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
output "router_id" {
|
output "router_id" {
|
||||||
value = "${openstack_networking_router_v2.k8s.id}"
|
value = "${element(concat(openstack_networking_router_v2.k8s.*.id, list("")), 0)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
output "router_internal_port_id" {
|
output "router_internal_port_id" {
|
||||||
value = "${openstack_networking_router_interface_v2.k8s.id}"
|
value = "${element(concat(openstack_networking_router_interface_v2.k8s.*.id, list("")), 0)}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
output "subnet_id" {
|
output "subnet_id" {
|
||||||
value = "${openstack_networking_subnet_v2.k8s.id}"
|
value = "${element(concat(openstack_networking_subnet_v2.k8s.*.id, list("")), 0)}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,3 +9,5 @@ variable "dns_nameservers" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "subnet_cidr" {}
|
variable "subnet_cidr" {}
|
||||||
|
|
||||||
|
variable "use_neutron" {}
|
||||||
|
|
|
@ -103,6 +103,11 @@ variable "network_name" {
|
||||||
default = "internal"
|
default = "internal"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "use_neutron" {
|
||||||
|
description = "Use neutron"
|
||||||
|
default = 1
|
||||||
|
}
|
||||||
|
|
||||||
variable "subnet_cidr" {
|
variable "subnet_cidr" {
|
||||||
description = "Subnet CIDR block."
|
description = "Subnet CIDR block."
|
||||||
type = "string"
|
type = "string"
|
||||||
|
|
Loading…
Reference in a new issue