Skip to content

feat: add support for windows config #2375

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

Merged
merged 2 commits into from
Jul 7, 2025
Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
4 changes: 4 additions & 0 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |

{% endif %}

## Requirements
Expand Down
8 changes: 8 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,14 @@ resource "google_container_node_pool" "windows_pools" {
}
{% endif %}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

{% if i == 0 %}
dynamic "linux_node_config" {
for_each = length(merge(
Expand Down
2 changes: 2 additions & 0 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ variable "node_pools_linux_node_configs_sysctls" {
default-node-pool = {}
}
}

variable "node_pools_cgroup_mode" {
type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"
Expand Down Expand Up @@ -295,6 +296,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
16 changes: 16 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,14 @@ resource "google_container_node_pool" "pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

dynamic "linux_node_config" {
for_each = length(merge(
local.node_pools_linux_node_configs_sysctls["all"],
Expand Down Expand Up @@ -1258,6 +1266,14 @@ resource "google_container_node_pool" "windows_pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}


boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
16 changes: 16 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,14 @@ resource "google_container_node_pool" "pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

dynamic "linux_node_config" {
for_each = length(merge(
local.node_pools_linux_node_configs_sysctls["all"],
Expand Down Expand Up @@ -1436,6 +1444,14 @@ resource "google_container_node_pool" "windows_pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}


boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ variable "node_pools_linux_node_configs_sysctls" {
default-node-pool = {}
}
}

variable "node_pools_cgroup_mode" {
type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"
Expand Down Expand Up @@ -274,6 +275,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
16 changes: 16 additions & 0 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,14 @@ resource "google_container_node_pool" "pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

dynamic "linux_node_config" {
for_each = length(merge(
local.node_pools_linux_node_configs_sysctls["all"],
Expand Down Expand Up @@ -1352,6 +1360,14 @@ resource "google_container_node_pool" "windows_pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}


boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ variable "node_pools_linux_node_configs_sysctls" {
default-node-pool = {}
}
}

variable "node_pools_cgroup_mode" {
type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"
Expand Down Expand Up @@ -274,6 +275,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
16 changes: 16 additions & 0 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,14 @@ resource "google_container_node_pool" "pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

dynamic "linux_node_config" {
for_each = length(merge(
local.node_pools_linux_node_configs_sysctls["all"],
Expand Down Expand Up @@ -1414,6 +1422,14 @@ resource "google_container_node_pool" "windows_pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}


boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ variable "node_pools_linux_node_configs_sysctls" {
default-node-pool = {}
}
}

variable "node_pools_cgroup_mode" {
type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"
Expand Down Expand Up @@ -274,6 +275,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
16 changes: 16 additions & 0 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,14 @@ resource "google_container_node_pool" "pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

dynamic "linux_node_config" {
for_each = length(merge(
local.node_pools_linux_node_configs_sysctls["all"],
Expand Down Expand Up @@ -1330,6 +1338,14 @@ resource "google_container_node_pool" "windows_pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}


boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ variable "node_pools_linux_node_configs_sysctls" {
default-node-pool = {}
}
}

variable "node_pools_cgroup_mode" {
type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"
Expand Down Expand Up @@ -274,6 +275,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
16 changes: 16 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,14 @@ resource "google_container_node_pool" "pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}

dynamic "linux_node_config" {
for_each = length(merge(
local.node_pools_linux_node_configs_sysctls["all"],
Expand Down Expand Up @@ -1363,6 +1371,14 @@ resource "google_container_node_pool" "windows_pools" {
}
}

dynamic "windows_node_config" {
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []

content {
osversion = lookup(each.value, "windows_node_config_os_version", null)
}
}


boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []
Expand Down
2 changes: 2 additions & 0 deletions modules/private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ variable "node_pools_linux_node_configs_sysctls" {
default-node-pool = {}
}
}

variable "node_pools_cgroup_mode" {
type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"
Expand Down Expand Up @@ -274,6 +275,7 @@ variable "enable_cost_allocation" {
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "resource_usage_export_dataset_id" {
type = string
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ The node_pools variable takes the following parameters:

The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| windows_node_config_os_version | The Windows OS version to use for the windows node pool. Valid values are OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019 and OS_VERSION_LTSC2022. | null | Optional |


## Requirements

Expand Down
Loading