mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-22 05:30:51 -03:30
Update OpenStack Terraform: Modules, Bastions, and New Floating IP config (#1958)
* Adding bastion and private network provisioning for openstack terraform * Remove usage of floating-ip property * Combine openstack instances + floating ips * Fix relating floating IPs to hosts for openstack builds * Tighten up security groups Allow ssh into all instances with floating IP * Add the gluster hosts to the no-floating group * Break terraform into modules * Update README and var descriptions to match current config * Remove volume property in gluster compute def * Include cluster name in internal network and router names * Make dns_nameservers a variable
This commit is contained in:
committed by
Matthew Mosesohn
parent
6ade7c0a8d
commit
591ae700ce
24
contrib/terraform/openstack/modules/network/main.tf
Normal file
24
contrib/terraform/openstack/modules/network/main.tf
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
resource "openstack_networking_router_v2" "k8s" {
|
||||
name = "${var.cluster_name}-router"
|
||||
admin_state_up = "true"
|
||||
external_gateway = "${var.external_net}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_network_v2" "k8s" {
|
||||
name = "${var.network_name}"
|
||||
admin_state_up = "true"
|
||||
}
|
||||
|
||||
resource "openstack_networking_subnet_v2" "k8s" {
|
||||
name = "${var.cluster_name}-internal-network"
|
||||
network_id = "${openstack_networking_network_v2.k8s.id}"
|
||||
cidr = "10.0.0.0/24"
|
||||
ip_version = 4
|
||||
dns_nameservers = "${var.dns_nameservers}"
|
||||
}
|
||||
|
||||
resource "openstack_networking_router_interface_v2" "k8s" {
|
||||
router_id = "${openstack_networking_router_v2.k8s.id}"
|
||||
subnet_id = "${openstack_networking_subnet_v2.k8s.id}"
|
||||
}
|
||||
7
contrib/terraform/openstack/modules/network/outputs.tf
Normal file
7
contrib/terraform/openstack/modules/network/outputs.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
output "router_id" {
|
||||
value = "${openstack_networking_router_interface_v2.k8s.id}"
|
||||
}
|
||||
|
||||
output "network_id" {
|
||||
value = "${openstack_networking_subnet_v2.k8s.id}"
|
||||
}
|
||||
13
contrib/terraform/openstack/modules/network/variables.tf
Normal file
13
contrib/terraform/openstack/modules/network/variables.tf
Normal file
@@ -0,0 +1,13 @@
|
||||
variable "external_net" {
|
||||
|
||||
}
|
||||
|
||||
variable "network_name" {
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
}
|
||||
|
||||
variable "dns_nameservers"{
|
||||
type = "list"
|
||||
}
|
||||
Reference in New Issue
Block a user