Skip to content

Commit 6b9749f

Browse files
authored
feat: add support for windows config (#2375)
Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
1 parent d80316b commit 6b9749f

File tree

26 files changed

+170
-0
lines changed

26 files changed

+170
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ The node_pools variable takes the following parameters:
402402

403403
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.
404404

405+
| Name | Description | Default | Requirement |
406+
| --- | --- | --- | --- |
407+
| 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 |
408+
405409

406410
## Requirements
407411

autogen/main/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ The node_pools variable takes the following parameters:
289289

290290
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.
291291

292+
| Name | Description | Default | Requirement |
293+
| --- | --- | --- | --- |
294+
| 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 |
295+
292296
{% endif %}
293297

294298
## Requirements

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,14 @@ resource "google_container_node_pool" "windows_pools" {
12151215
}
12161216
{% endif %}
12171217

1218+
dynamic "windows_node_config" {
1219+
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []
1220+
1221+
content {
1222+
osversion = lookup(each.value, "windows_node_config_os_version", null)
1223+
}
1224+
}
1225+
12181226
{% if i == 0 %}
12191227
dynamic "linux_node_config" {
12201228
for_each = length(merge(

autogen/main/variables.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ variable "node_pools_linux_node_configs_sysctls" {
256256
default-node-pool = {}
257257
}
258258
}
259+
259260
variable "node_pools_cgroup_mode" {
260261
type = map(string)
261262
description = "Map of strings containing cgroup node config by node-pool name"
@@ -295,6 +296,7 @@ variable "enable_cost_allocation" {
295296
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"
296297
default = false
297298
}
299+
298300
variable "resource_usage_export_dataset_id" {
299301
type = string
300302
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."

cluster.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,14 @@ resource "google_container_node_pool" "pools" {
903903
}
904904
}
905905

906+
dynamic "windows_node_config" {
907+
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []
908+
909+
content {
910+
osversion = lookup(each.value, "windows_node_config_os_version", null)
911+
}
912+
}
913+
906914
dynamic "linux_node_config" {
907915
for_each = length(merge(
908916
local.node_pools_linux_node_configs_sysctls["all"],
@@ -1258,6 +1266,14 @@ resource "google_container_node_pool" "windows_pools" {
12581266
}
12591267
}
12601268

1269+
dynamic "windows_node_config" {
1270+
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []
1271+
1272+
content {
1273+
osversion = lookup(each.value, "windows_node_config_os_version", null)
1274+
}
1275+
}
1276+
12611277

12621278
boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
12631279
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []

modules/beta-autopilot-private-cluster/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ variable "enable_cost_allocation" {
182182
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"
183183
default = false
184184
}
185+
185186
variable "resource_usage_export_dataset_id" {
186187
type = string
187188
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."

modules/beta-autopilot-public-cluster/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ variable "enable_cost_allocation" {
182182
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"
183183
default = false
184184
}
185+
185186
variable "resource_usage_export_dataset_id" {
186187
type = string
187188
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."

modules/beta-private-cluster-update-variant/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ The node_pools variable takes the following parameters:
456456

457457
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.
458458

459+
| Name | Description | Default | Requirement |
460+
| --- | --- | --- | --- |
461+
| 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 |
462+
459463

460464
## Requirements
461465

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,14 @@ resource "google_container_node_pool" "pools" {
10671067
}
10681068
}
10691069

1070+
dynamic "windows_node_config" {
1071+
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []
1072+
1073+
content {
1074+
osversion = lookup(each.value, "windows_node_config_os_version", null)
1075+
}
1076+
}
1077+
10701078
dynamic "linux_node_config" {
10711079
for_each = length(merge(
10721080
local.node_pools_linux_node_configs_sysctls["all"],
@@ -1436,6 +1444,14 @@ resource "google_container_node_pool" "windows_pools" {
14361444
}
14371445
}
14381446

1447+
dynamic "windows_node_config" {
1448+
for_each = lookup(each.value, "windows_node_config_os_version", null) != null ? [true] : []
1449+
1450+
content {
1451+
osversion = lookup(each.value, "windows_node_config_os_version", null)
1452+
}
1453+
}
1454+
14391455

14401456
boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
14411457
storage_pools = lookup(each.value, "storage_pools", null) != null ? [each.value.storage_pools] : []

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ variable "node_pools_linux_node_configs_sysctls" {
236236
default-node-pool = {}
237237
}
238238
}
239+
239240
variable "node_pools_cgroup_mode" {
240241
type = map(string)
241242
description = "Map of strings containing cgroup node config by node-pool name"
@@ -274,6 +275,7 @@ variable "enable_cost_allocation" {
274275
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"
275276
default = false
276277
}
278+
277279
variable "resource_usage_export_dataset_id" {
278280
type = string
279281
description = "The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export."

0 commit comments

Comments
 (0)