-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi az for azure #179
Multi az for azure #179
Conversation
5e4685d
to
fcde56d
Compare
modules/azure/scalardl/envoy.tf
Outdated
domain_name_label = "envoy-${local.network_name}" | ||
location = local.location | ||
sku = length(local.locations) > 0 ? "Standard" : "Basic" | ||
# zones = length(local.locations) > 0 ? [local.locations[count.index]] : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Standard SKU Public IP Addresses that do not specify a zone are zone redundant by default.
https://www.terraform.io/docs/providers/azurerm/r/public_ip.html#zones
modules/azure/scalardl/envoy.tf
Outdated
resource "azurerm_public_ip" "envoy_nat_ip" { | ||
count = local.envoy.enable_nlb && local.envoy.nlb_internal && length(local.locations) > 0 ? 1 : 0 | ||
|
||
name = "envoy-natip" | ||
location = local.location | ||
resource_group_name = local.network_name | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
} | ||
|
||
resource "azurerm_nat_gateway" "envoy_natgw" { | ||
count = local.envoy.enable_nlb && local.envoy.nlb_internal && length(local.locations) > 0 ? 1 : 0 | ||
|
||
name = "envoy-natgw" | ||
location = local.location | ||
resource_group_name = local.network_name | ||
public_ip_address_ids = [azurerm_public_ip.envoy_nat_ip[count.index].id] | ||
sku_name = "Standard" | ||
idle_timeout_in_minutes = 10 | ||
} | ||
|
||
resource "azurerm_subnet_nat_gateway_association" "envoy_natgw_assoc" { | ||
count = local.envoy.enable_nlb && local.envoy.nlb_internal && length(local.locations) > 0 ? 1 : 0 | ||
|
||
subnet_id = local.envoy.subnet_id | ||
nat_gateway_id = azurerm_nat_gateway.envoy_natgw[count.index].id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Need outbound NAT when using internal standard lb. (NAT associated with private subnet that include monitoring server)
https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections
6fa9766
to
5d97c84
Compare
Kubernetes modules work well with a bit of modification => reimport master to this branch for fix region I have 2 questions:
locals.tf in Kubernetes examples
main.tf in Kubernetes examples
|
Good point! 👍 Agree ! fixed in e8562ce.
It's a minor correction, so I fixed it directly. |
|
||
lifecycle { | ||
ignore_changes = [network_security_group_id] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Removed lifecycle
because it didn't seem to be necessary.
Refactored the k8s part to use |
Great thank you |
@@ -9,7 +9,7 @@ module "bastion_cluster" { | |||
vm_hostname = "bastion" | |||
vm_os_simple = var.image_id | |||
vnet_subnet_id = var.subnet_id | |||
nb_public_ip = "1" | |||
nb_public_ip = var.resource_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tei-k I try to start 3 bastions and got the following error, we should add a random to the dns for public IP
Error: Error Creating/Updating Public IP "bastion-2-publicIP" (Resource Group "paul-k8s-azure-s9rt0ek"): network.PublicIPAddressesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="DnsRecordInUse" Message="DNS record bastion-paul-k8s-azure-s9rt0ek.westus2.cloudapp.azure.com is already used by another public IP." Details=[]
on .terraform/modules/network.bastion.bastion_cluster/main.tf line 251, in resource "azurerm_public_ip" "vm":
251: resource "azurerm_public_ip" "vm" {
Error: Error Creating/Updating Public IP "bastion-3-publicIP" (Resource Group "paul-k8s-azure-s9rt0ek"): network.PublicIPAddressesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="DnsRecordInUse" Message="DNS record bastion-paul-k8s-azure-s9rt0ek.westus2.cloudapp.azure.com is already used by another public IP." Details=[]
on .terraform/modules/network.bastion.bastion_cluster/main.tf line 251, in resource "azurerm_public_ip" "vm":
251: resource "azurerm_public_ip" "vm" {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, Look good to me !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tei-k one last thing, should we modify the outputs.tf (network modules) as well to include the x
number of bastion servers to give the user the public dns in output terraform command.
I say that because Kubernetes must use only one bastion but the tools (helm, kubectl) need to be available on everyone on them.
I propose to keep bastion_ip
and create bastions_ip
as follow, let's me know what do you think?
output "bastion_ip" {
value = module.network.bastion_ip
}
output "bastions_ip" {
[OMIT]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's OK to add it to the output, but also need to fix aws as well, So let me do it in other pr. (may not need it now.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work!
Since it is an important PR, I would like to wait for 2 more approvals from Paul and Yusuke.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Left one minor comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
https://scalar-labs.atlassian.net/browse/DLT-6944
Done
locations
)Remark
Update ref after merge following pr.
scalar-labs/terraform-azurerm-compute#7