Skip to content
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

Added the option for vm max_map_count. #394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ module "node_pools" {
orchestrator_version = var.kubernetes_version
enable_host_encryption = var.aks_cluster_enable_host_encryption
tags = var.tags
linux_os_config = each.value.linux_os_config
}

# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server
Expand Down
12 changes: 12 additions & 0 deletions modules/aks_node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ resource "azurerm_kubernetes_cluster_node_pool" "autoscale_node_pool" {
lifecycle {
ignore_changes = [node_count]
}

linux_os_config {
sysctl_config {
vm_max_map_count = try(var.linux_os_config.sysctl_config.vm_max_map_count,null)
}
}
}

resource "azurerm_kubernetes_cluster_node_pool" "static_node_pool" {
Expand All @@ -57,4 +63,10 @@ resource "azurerm_kubernetes_cluster_node_pool" "static_node_pool" {
node_taints = var.node_taints
orchestrator_version = var.orchestrator_version
tags = var.tags

linux_os_config {
sysctl_config {
vm_max_map_count = try(var.linux_os_config.sysctl_config.vm_max_map_count,null)
}
}
}
10 changes: 10 additions & 0 deletions modules/aks_node_pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,13 @@ variable "proximity_placement_group_id" {
# type = number
# default = -1
# }

variable "linux_os_config"{
description = "Specifications of linux os config. Changing this forces a new resource to be created."
type = object({
sysctl_config = optional(object({
vm_max_map_count = optional(number)
}))
})
default = {}
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ variable "node_pools" {
max_pods = string
node_taints = list(string)
node_labels = map(string)
linux_os_config = optional(object({
sysctl_config = optional(object({
vm_max_map_count = optional(number)
}))
}))
}))

default = {
Expand Down