Skip to content

Commit

Permalink
feat: improve naming node pools (#25)
Browse files Browse the repository at this point in the history
Co-authored-by: dkool <dkool@dkools-MacBook-Pro.local>
  • Loading branch information
dkooll and dkool authored Jan 29, 2024
1 parent 161744a commit c83c82b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/node-pools/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ locals {
node_count = 2
zones = [1, 2]
mode = "User"
os_type = "Linux"
node_labels = {
"workload" = "database"
}
Expand All @@ -24,6 +25,7 @@ locals {
vnet_subnet_id = module.network.subnets.cache.id
node_count = 2
zones = [1]
os_type = "Linux"
node_labels = {
"workload" = "cache"
}
Expand Down
8 changes: 6 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ locals {
max_count = try(pools.max_count, 0)
min_count = try(pools.min_count, 0)
max_surge = try(pools.max_surge, 50)
poolname = "aks${pools_key}"
aks_cluster_id = azurerm_kubernetes_cluster.aks.id

poolname = try(
pools.name,
pools.os_type == "Linux" ? "npl${pools_key}" : "npw${pools_key}"
)

linux_os_config = try(pools.config.linux_os, {
swap_file_size_mb = "none"
transparent_huge_page_defrag = "madvise"
Expand All @@ -33,7 +37,7 @@ locals {
workload_runtime = try(pools.workload_runtime, null)
snapshot_id = try(pools.snapshot_id, null)
priority = try(pools.priority, null)
os_type = try(pools.os_type, null)
os_type = try(pools.os_type, "Linux")
os_sku = try(pools.os_sku, null)
node_labels = try(pools.node_labels, {})
node_taints = try(pools.node_taints, [])
Expand Down

0 comments on commit c83c82b

Please sign in to comment.