terraform/openstack: add network_dns_domain variable (#5093)
This allows the user to optionally specify the dns_domain attribute on the generated internal kubernetes network.pull/5102/head
parent
f6a63d88a7
commit
3732c3a9b1
|
@ -225,6 +225,7 @@ For your cluster, edit `inventory/$CLUSTER/cluster.tfvars`.
|
|||
|---------|-------------|
|
||||
|`cluster_name` | All OpenStack resources will use the Terraform variable`cluster_name` (default`example`) in their name to make it easier to track. For example the first compute resource will be named`example-kubernetes-1`. |
|
||||
|`network_name` | The name to be given to the internal network that will be generated |
|
||||
|`network_dns_domain` | (Optional) The dns_domain for the internal network that will be generated |
|
||||
|`dns_nameservers`| An array of DNS name server names to be used by hosts in the internal subnet. |
|
||||
|`floatingip_pool` | Name of the pool from which floating IPs will be allocated |
|
||||
|`external_net` | UUID of the external network that will be routed to |
|
||||
|
|
|
@ -10,6 +10,7 @@ module "network" {
|
|||
subnet_cidr = "${var.subnet_cidr}"
|
||||
cluster_name = "${var.cluster_name}"
|
||||
dns_nameservers = "${var.dns_nameservers}"
|
||||
network_dns_domain = "${var.network_dns_domain}"
|
||||
use_neutron = "${var.use_neutron}"
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ resource "openstack_networking_router_v2" "k8s" {
|
|||
resource "openstack_networking_network_v2" "k8s" {
|
||||
name = "${var.network_name}"
|
||||
count = "${var.use_neutron}"
|
||||
dns_domain = var.network_dns_domain != null ? "${var.network_dns_domain}" : null
|
||||
admin_state_up = "true"
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ variable "external_net" {}
|
|||
|
||||
variable "network_name" {}
|
||||
|
||||
variable "network_dns_domain" {}
|
||||
|
||||
variable "cluster_name" {}
|
||||
|
||||
variable "dns_nameservers" {
|
||||
|
|
|
@ -103,6 +103,12 @@ variable "network_name" {
|
|||
default = "internal"
|
||||
}
|
||||
|
||||
variable "network_dns_domain" {
|
||||
description = "dns_domain for the internal network"
|
||||
type = "string"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "use_neutron" {
|
||||
description = "Use neutron"
|
||||
default = 1
|
||||
|
|
Loading…
Reference in New Issue