Enable boot diagnostics for Azure controller and worker VMs

* When invalid Ignition snippets are provided to Typhoon, it
can be useful to view Azure's boot logs for the instance, which
requires boot diagnostics be enabled
This commit is contained in:
Dalton Hubble 2023-06-11 19:20:45 -07:00
parent 58e0ff9f5e
commit 784f60f624
3 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,10 @@ Notable changes between versions.
## Latest ## Latest
### Azure
* Enable boot diagnostics for controller and worker VMs ([#1351](https://github.com/poseidon/typhoon/pull/1351))
## v1.27.2 ## v1.27.2
* Kubernetes [v1.27.2](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.27.md#v1272) * Kubernetes [v1.27.2](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.27.md#v1272)

View File

@ -44,6 +44,9 @@ resource "azurerm_linux_virtual_machine" "controllers" {
size = var.controller_type size = var.controller_type
custom_data = base64encode(data.ct_config.controllers.*.rendered[count.index]) custom_data = base64encode(data.ct_config.controllers.*.rendered[count.index])
boot_diagnostics {
# defaults to a managed storage account
}
# storage # storage
os_disk { os_disk {
@ -72,7 +75,7 @@ resource "azurerm_linux_virtual_machine" "controllers" {
# network # network
network_interface_ids = [ network_interface_ids = [
azurerm_network_interface.controllers.*.id[count.index] azurerm_network_interface.controllers[count.index].id
] ]
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too # Azure requires setting admin_ssh_key, though Ignition custom_data handles it too

View File

@ -17,6 +17,9 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" {
computer_name_prefix = "${var.name}-worker" computer_name_prefix = "${var.name}-worker"
single_placement_group = false single_placement_group = false
custom_data = base64encode(data.ct_config.worker.rendered) custom_data = base64encode(data.ct_config.worker.rendered)
boot_diagnostics {
# defaults to a managed storage account
}
# storage # storage
os_disk { os_disk {
@ -69,6 +72,9 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" {
# eviction policy may only be set when priority is Spot # eviction policy may only be set when priority is Spot
priority = var.priority priority = var.priority
eviction_policy = var.priority == "Spot" ? "Delete" : null eviction_policy = var.priority == "Spot" ? "Delete" : null
termination_notification {
enabled = true
}
} }
# Scale up or down to maintain desired number, tolerating deallocations. # Scale up or down to maintain desired number, tolerating deallocations.