mirror of
				https://github.com/optim-enterprises-bv/terraform-talos.git
				synced 2025-10-30 17:58:32 +00:00 
			
		
		
		
	bootstrap fixes
This commit is contained in:
		| @@ -3,7 +3,7 @@ terraform { | ||||
|   required_providers { | ||||
|     azurerm = { | ||||
|       source  = "hashicorp/azurerm" | ||||
|       version = "3.6.0" | ||||
|       version = "3.7.0" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -3,7 +3,7 @@ terraform { | ||||
|   required_providers { | ||||
|     azurerm = { | ||||
|       source  = "hashicorp/azurerm" | ||||
|       version = "3.6.0" | ||||
|       version = "3.7.0" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ resource "azurerm_availability_set" "controlplane" { | ||||
|   resource_group_name = local.resource_group | ||||
|  | ||||
|   platform_update_domain_count = 1 | ||||
|   platform_fault_domain_count  = 1 | ||||
|   platform_fault_domain_count  = 2 | ||||
|  | ||||
|   tags = merge(var.tags, { type = "infra" }) | ||||
| } | ||||
|   | ||||
| @@ -51,8 +51,8 @@ resource "azurerm_linux_virtual_machine_scale_set" "worker" { | ||||
|  | ||||
|   os_disk { | ||||
|     caching              = "ReadOnly" | ||||
|     storage_account_type = "StandardSSD_LRS" | ||||
|     disk_size_gb         = lookup(try(var.instances[each.key], {}), "worker_os_ephemeral", false) ? null : 50 | ||||
|     storage_account_type = lookup(try(var.instances[each.key], {}), "worker_os_ephemeral", false) ? "Standard_LRS" : "StandardSSD_LRS" | ||||
|     disk_size_gb         = lookup(try(var.instances[each.key], {}), "worker_os_ephemeral", false) ? 50 : 50 | ||||
|  | ||||
|     dynamic "diff_disk_settings" { | ||||
|       for_each = lookup(try(var.instances[each.key], {}), "worker_os_ephemeral", false) ? ["Local"] : [] | ||||
| @@ -83,6 +83,6 @@ resource "azurerm_linux_virtual_machine_scale_set" "worker" { | ||||
|  | ||||
|   boot_diagnostics {} | ||||
|   lifecycle { | ||||
|     ignore_changes = [instances, admin_username, admin_ssh_key, os_disk, source_image_id] | ||||
|     ignore_changes = [instances, admin_username, admin_ssh_key, source_image_id] | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -81,7 +81,6 @@ resource "azurerm_linux_virtual_machine" "controlplane" { | ||||
|   computer_name              = "controlplane-${lower(var.region)}-${1 + count.index}" | ||||
|   resource_group_name        = var.instance_resource_group | ||||
|   location                   = var.region | ||||
|   extensions_time_budget     = "PT1H30M" | ||||
|   size                       = var.instance_type | ||||
|   allow_extension_operations = false | ||||
|   provision_vm_agent         = false | ||||
| @@ -155,7 +154,7 @@ resource "local_file" "controlplane" { | ||||
|         try(azurerm_public_ip.controlplane_v6[count.index].ip_address, ""), | ||||
|       ]) | ||||
|       ipAliases   = compact([var.instance_params["lbv4"], var.instance_params["lbv6"]]) | ||||
|       nodeSubnets = [var.network_internal.cidr[0], "!${var.instance_params["lbv4"]}"] | ||||
|       nodeSubnets = [cidrsubnet(var.network_internal.cidr[0], 1, 0), "!${var.instance_params["lbv4"]}"] | ||||
|     }) | ||||
|   ) | ||||
|   filename        = "_cfgs/controlplane-${lower(var.region)}-${1 + count.index}.yaml" | ||||
|   | ||||
| @@ -7,6 +7,8 @@ output "controlplane_endpoints" { | ||||
|  | ||||
| output "controlplane_bootstrap" { | ||||
|   description = "Kubernetes controlplane bootstrap command" | ||||
|   value       = var.instance_count > 0 ? "talosctl apply-config --insecure --nodes ${try([for ip in azurerm_public_ip.controlplane_v4 : ip.ip_address], [""])[0]} --file _cfgs/controlplane-${lower(var.region)}-1.yaml" : "" | ||||
|   depends_on  = [azurerm_linux_virtual_machine.controlplane] | ||||
|   value = var.instance_count > 0 ? try([ | ||||
|     for n, ip in azurerm_public_ip.controlplane_v4 : "talosctl apply-config --insecure --nodes ${ip.ip_address} --file _cfgs/controlplane-${lower(var.region)}-${n + 1}.yaml" if ip.ip_address != "" | ||||
|   ]) : [] | ||||
|   depends_on = [azurerm_linux_virtual_machine.controlplane] | ||||
| } | ||||
|   | ||||
| @@ -3,7 +3,7 @@ terraform { | ||||
|   required_providers { | ||||
|     azurerm = { | ||||
|       source  = "hashicorp/azurerm" | ||||
|       version = "3.6.0" | ||||
|       version = "3.7.0" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -18,6 +18,7 @@ output "network" { | ||||
|   description = "The network" | ||||
|   value = { for zone, net in azurerm_virtual_network.main : zone => { | ||||
|     name = net.name | ||||
|     nat  = try(azurerm_public_ip.nat[zone].ip_address, "") | ||||
|   } } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -30,22 +30,22 @@ resource "azurerm_network_security_group" "controlplane" { | ||||
|       protocol                   = "Tcp" | ||||
|       source_port_range          = "*" | ||||
|       source_address_prefix      = security_rule.value | ||||
|       destination_port_ranges    = ["6443", "50000-50001", "22"] | ||||
|       destination_port_ranges    = ["6443", "50000-50001"] | ||||
|       destination_address_prefix = "*" | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   security_rule { | ||||
|     name                       = "etcd" | ||||
|     priority                   = 1550 | ||||
|     direction                  = "Inbound" | ||||
|     access                     = "Allow" | ||||
|     protocol                   = "Tcp" | ||||
|     source_port_range          = "*" | ||||
|     source_address_prefix      = "*" | ||||
|     destination_port_range     = "2379-2380" | ||||
|     destination_address_prefix = "*" | ||||
|   } | ||||
|   # security_rule { | ||||
|   #   name                       = "etcd" | ||||
|   #   priority                   = 1550 | ||||
|   #   direction                  = "Inbound" | ||||
|   #   access                     = "Allow" | ||||
|   #   protocol                   = "Tcp" | ||||
|   #   source_port_range          = "*" | ||||
|   #   source_address_prefix      = "*" | ||||
|   #   destination_port_range     = "2379-2380" | ||||
|   #   destination_address_prefix = "*" | ||||
|   # } | ||||
|  | ||||
|   tags = merge(var.tags, { type = "infra" }) | ||||
| } | ||||
|   | ||||
| @@ -3,7 +3,7 @@ terraform { | ||||
|   required_providers { | ||||
|     azurerm = { | ||||
|       source  = "hashicorp/azurerm" | ||||
|       version = "3.6.0" | ||||
|       version = "3.7.0" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -51,7 +51,8 @@ cluster: | ||||
|         node-cidr-mask-size-ipv4: 24 | ||||
|         node-cidr-mask-size-ipv6: 112 | ||||
|   scheduler: {} | ||||
|   etcd: {} | ||||
|   etcd: | ||||
|     subnet: ${nodeSubnets[0]} | ||||
|   inlineManifests: | ||||
|     - name: azure-cloud-controller-config | ||||
|       contents: |- | ||||
|   | ||||
| @@ -3,7 +3,7 @@ terraform { | ||||
|   required_providers { | ||||
|     azurerm = { | ||||
|       source  = "hashicorp/azurerm" | ||||
|       version = "3.6.0" | ||||
|       version = "3.7.0" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Serge Logvinov
					Serge Logvinov