Skip to content

Commit 6241143

Browse files
committed
Make possible to use different snapshots for different node pools
1 parent b4bc4f1 commit 6241143

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool" {
599599
vnet_subnet_id = each.value.vnet_subnet_id
600600
workload_runtime = each.value.workload_runtime
601601
zones = each.value.zones
602-
snapshot_id = var.snapshot_id
602+
snapshot_id = each.value.snapshot_id
603603

604604
dynamic "kubelet_config" {
605605
for_each = each.value.kubelet_config == null ? [] : ["kubelet_config"]

variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ variable "node_pools" {
845845
proximity_placement_group_id = optional(string)
846846
spot_max_price = optional(number)
847847
scale_down_mode = optional(string, "Delete")
848+
snapshot_id = optional(string)
848849
ultra_ssd_enabled = optional(bool)
849850
vnet_subnet_id = optional(string)
850851
upgrade_settings = optional(object({
@@ -942,6 +943,7 @@ variable "node_pools" {
942943
proximity_placement_group_id = (Optional) The ID of the Proximity Placement Group where the Virtual Machine Scale Set that powers this Node Pool will be placed. Changing this forces a new resource to be created. When setting `priority` to Spot - you must configure an `eviction_policy`, `spot_max_price` and add the applicable `node_labels` and `node_taints` [as per the Azure Documentation](https://docs.microsoft.com/azure/aks/spot-node-pool).
943944
spot_max_price = (Optional) The maximum price you're willing to pay in USD per Virtual Machine. Valid values are `-1` (the current on-demand price for a Virtual Machine) or a positive value with up to five decimal places. Changing this forces a new resource to be created. This field can only be configured when `priority` is set to `Spot`.
944945
scale_down_mode = (Optional) Specifies how the node pool should deal with scaled-down nodes. Allowed values are `Delete` and `Deallocate`. Defaults to `Delete`.
946+
snapshot_id = (Optional) The ID of the Snapshot which should be used to create this Node Pool. Changing this forces a new resource to be created.
945947
ultra_ssd_enabled = (Optional) Used to specify whether the UltraSSD is enabled in the Node Pool. Defaults to `false`. See [the documentation](https://docs.microsoft.com/azure/aks/use-ultra-disks) for more information. Changing this forces a new resource to be created.
946948
vnet_subnet_id = (Optional) The ID of the Subnet where this Node Pool should exist. Changing this forces a new resource to be created. A route table must be configured on this Subnet.
947949
upgrade_settings = optional(object({

0 commit comments

Comments
 (0)