Skip to content

Commit d334336

Browse files
committed
feat: Add secondary_boot_disks to node_pool configuration.
1 parent dbd90e3 commit d334336

File tree

16 files changed

+128
-0
lines changed

16 files changed

+128
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ The node_pools variable takes the following parameters:
322322
| value | The value for the taint | | Required |
323323
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
324324
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
325+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
325326

326327
## windows_node_pools variable
327328
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.

autogen/main/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ The node_pools variable takes the following parameters:
250250
| value | The value for the taint | | Required |
251251
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
252252
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
253+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
253254

254255
## windows_node_pools variable
255256
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.

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,14 @@ resource "google_container_node_pool" "windows_pools" {
856856
}
857857
}
858858

859+
dynamic "secondary_boot_disks" {
860+
for_each = lookup(each.value, "secondary_boot_disks", [])
861+
content {
862+
disk_image = secondary_boot_disks.value.disk_image
863+
mode = secondary_boot_disks.value.mode
864+
}
865+
}
866+
859867
service_account = lookup(
860868
each.value,
861869
"service_account",

cluster.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,14 @@ resource "google_container_node_pool" "pools" {
574574
}
575575
}
576576

577+
dynamic "secondary_boot_disks" {
578+
for_each = lookup(each.value, "secondary_boot_disks", [])
579+
content {
580+
disk_image = secondary_boot_disks.value.disk_image
581+
mode = secondary_boot_disks.value.mode
582+
}
583+
}
584+
577585
service_account = lookup(
578586
each.value,
579587
"service_account",
@@ -790,6 +798,14 @@ resource "google_container_node_pool" "windows_pools" {
790798
}
791799
}
792800

801+
dynamic "secondary_boot_disks" {
802+
for_each = lookup(each.value, "secondary_boot_disks", [])
803+
content {
804+
disk_image = secondary_boot_disks.value.disk_image
805+
mode = secondary_boot_disks.value.mode
806+
}
807+
}
808+
793809
service_account = lookup(
794810
each.value,
795811
"service_account",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ The node_pools variable takes the following parameters:
390390
| value | The value for the taint | | Required |
391391
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
392392
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
393+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
393394

394395
## windows_node_pools variable
395396
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.

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,14 @@ resource "google_container_node_pool" "pools" {
740740
}
741741
}
742742

743+
dynamic "secondary_boot_disks" {
744+
for_each = lookup(each.value, "secondary_boot_disks", [])
745+
content {
746+
disk_image = secondary_boot_disks.value.disk_image
747+
mode = secondary_boot_disks.value.mode
748+
}
749+
}
750+
743751
service_account = lookup(
744752
each.value,
745753
"service_account",
@@ -982,6 +990,14 @@ resource "google_container_node_pool" "windows_pools" {
982990
}
983991
}
984992

993+
dynamic "secondary_boot_disks" {
994+
for_each = lookup(each.value, "secondary_boot_disks", [])
995+
content {
996+
disk_image = secondary_boot_disks.value.disk_image
997+
mode = secondary_boot_disks.value.mode
998+
}
999+
}
1000+
9851001
service_account = lookup(
9861002
each.value,
9871003
"service_account",

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ The node_pools variable takes the following parameters:
368368
| value | The value for the taint | | Required |
369369
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
370370
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
371+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
371372

372373
## windows_node_pools variable
373374
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.

modules/beta-private-cluster/cluster.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,14 @@ resource "google_container_node_pool" "pools" {
665665
}
666666
}
667667

668+
dynamic "secondary_boot_disks" {
669+
for_each = lookup(each.value, "secondary_boot_disks", [])
670+
content {
671+
disk_image = secondary_boot_disks.value.disk_image
672+
mode = secondary_boot_disks.value.mode
673+
}
674+
}
675+
668676
service_account = lookup(
669677
each.value,
670678
"service_account",
@@ -906,6 +914,14 @@ resource "google_container_node_pool" "windows_pools" {
906914
}
907915
}
908916

917+
dynamic "secondary_boot_disks" {
918+
for_each = lookup(each.value, "secondary_boot_disks", [])
919+
content {
920+
disk_image = secondary_boot_disks.value.disk_image
921+
mode = secondary_boot_disks.value.mode
922+
}
923+
}
924+
909925
service_account = lookup(
910926
each.value,
911927
"service_account",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ The node_pools variable takes the following parameters:
378378
| value | The value for the taint | | Required |
379379
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
380380
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
381+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
381382

382383
## windows_node_pools variable
383384
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.

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,14 @@ resource "google_container_node_pool" "pools" {
721721
}
722722
}
723723

724+
dynamic "secondary_boot_disks" {
725+
for_each = lookup(each.value, "secondary_boot_disks", [])
726+
content {
727+
disk_image = secondary_boot_disks.value.disk_image
728+
mode = secondary_boot_disks.value.mode
729+
}
730+
}
731+
724732
service_account = lookup(
725733
each.value,
726734
"service_account",
@@ -963,6 +971,14 @@ resource "google_container_node_pool" "windows_pools" {
963971
}
964972
}
965973

974+
dynamic "secondary_boot_disks" {
975+
for_each = lookup(each.value, "secondary_boot_disks", [])
976+
content {
977+
disk_image = secondary_boot_disks.value.disk_image
978+
mode = secondary_boot_disks.value.mode
979+
}
980+
}
981+
966982
service_account = lookup(
967983
each.value,
968984
"service_account",

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ The node_pools variable takes the following parameters:
356356
| value | The value for the taint | | Required |
357357
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
358358
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
359+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
359360

360361
## windows_node_pools variable
361362
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.

modules/beta-public-cluster/cluster.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,14 @@ resource "google_container_node_pool" "pools" {
646646
}
647647
}
648648

649+
dynamic "secondary_boot_disks" {
650+
for_each = lookup(each.value, "secondary_boot_disks", [])
651+
content {
652+
disk_image = secondary_boot_disks.value.disk_image
653+
mode = secondary_boot_disks.value.mode
654+
}
655+
}
656+
649657
service_account = lookup(
650658
each.value,
651659
"service_account",
@@ -887,6 +895,14 @@ resource "google_container_node_pool" "windows_pools" {
887895
}
888896
}
889897

898+
dynamic "secondary_boot_disks" {
899+
for_each = lookup(each.value, "secondary_boot_disks", [])
900+
content {
901+
disk_image = secondary_boot_disks.value.disk_image
902+
mode = secondary_boot_disks.value.mode
903+
}
904+
}
905+
890906
service_account = lookup(
891907
each.value,
892908
"service_account",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ The node_pools variable takes the following parameters:
357357
| value | The value for the taint | | Required |
358358
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
359359
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
360+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
360361

361362
## windows_node_pools variable
362363
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.

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,14 @@ resource "google_container_node_pool" "pools" {
668668
}
669669
}
670670

671+
dynamic "secondary_boot_disks" {
672+
for_each = lookup(each.value, "secondary_boot_disks", [])
673+
content {
674+
disk_image = secondary_boot_disks.value.disk_image
675+
mode = secondary_boot_disks.value.mode
676+
}
677+
}
678+
671679
service_account = lookup(
672680
each.value,
673681
"service_account",
@@ -885,6 +893,14 @@ resource "google_container_node_pool" "windows_pools" {
885893
}
886894
}
887895

896+
dynamic "secondary_boot_disks" {
897+
for_each = lookup(each.value, "secondary_boot_disks", [])
898+
content {
899+
disk_image = secondary_boot_disks.value.disk_image
900+
mode = secondary_boot_disks.value.mode
901+
}
902+
}
903+
888904
service_account = lookup(
889905
each.value,
890906
"service_account",

modules/private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ The node_pools variable takes the following parameters:
335335
| value | The value for the taint | | Required |
336336
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |
337337
| location_policy | [Location policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#location_policy) specifies the algorithm used when scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. | " " | Optional |
338+
| secondary_boot_disks | Parameters for secondary boot disks to preload container images and data on new nodes. Structure is [documented here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_secondary_boot_disks). `gcfs_config` must be `enabled=true` for this feature to work. | | Optional |
338339

339340
## windows_node_pools variable
340341
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.

modules/private-cluster/cluster.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ resource "google_container_node_pool" "pools" {
593593
}
594594
}
595595

596+
dynamic "secondary_boot_disks" {
597+
for_each = lookup(each.value, "secondary_boot_disks", [])
598+
content {
599+
disk_image = secondary_boot_disks.value.disk_image
600+
mode = secondary_boot_disks.value.mode
601+
}
602+
}
603+
596604
service_account = lookup(
597605
each.value,
598606
"service_account",
@@ -809,6 +817,14 @@ resource "google_container_node_pool" "windows_pools" {
809817
}
810818
}
811819

820+
dynamic "secondary_boot_disks" {
821+
for_each = lookup(each.value, "secondary_boot_disks", [])
822+
content {
823+
disk_image = secondary_boot_disks.value.disk_image
824+
mode = secondary_boot_disks.value.mode
825+
}
826+
}
827+
812828
service_account = lookup(
813829
each.value,
814830
"service_account",

0 commit comments

Comments
 (0)