Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
azure-terraform: custom vnet resource group (#3323)
If you specify custom vnet using `tectonic_azure_external_vnet_id`
and this belongs to a different resource group than where massters
and workers are located, Kubernetes Services of type LoadBalancer will
fail. Support for setting custom resource group for vnet in cloud config
was added in Kubernetes 1.6 using `vnetResourceGroup`. This will add
the `vnetResourceGroup` to the cloud config if
`tectonic_azure_external_vnet_id` is set.

Signed-off-by: Daniel Spangenberg <daniel.spangenberg@coreos.com>
  • Loading branch information
spangenberg committed Jul 5, 2018
1 parent 0ec6b27 commit 09f3747
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/azure/vnet/outputs.tf
Expand Up @@ -14,6 +14,10 @@ output "worker_subnet_name" {
value = "${var.external_vnet_id == "" ? element(concat(azurerm_subnet.worker_subnet.*.name, list("")), 0) : replace(var.external_vnet_id, var.const_id_to_group_name_regex, "$2")}"
}

output "vnet_resource_group" {
value = "${var.external_vnet_id == "" ? "" : replace(var.external_vnet_id, var.const_id_to_group_name_regex, "$1")}"
}

# TODO: Allow user to provide their own network
output "etcd_cidr" {
value = "${element(concat(azurerm_subnet.master_subnet.*.address_prefix, list("")), 0)}"
Expand Down
1 change: 1 addition & 0 deletions platforms/azure/main.tf
Expand Up @@ -96,6 +96,7 @@ data "null_data_source" "cloud_provider" {
"subscriptionId" = "${data.azurerm_client_config.current.subscription_id}"
"tenantId" = "${data.azurerm_client_config.current.tenant_id}"
"vnetName" = "${module.vnet.vnet_id}"
"vnetResourceGroup" = "${module.vnet.vnet_resource_group}"
}
}

Expand Down

0 comments on commit 09f3747

Please sign in to comment.