Skip to content

Commit 04ebd0c

Browse files
authored
feat: Add local_ssd_ephemeral_count to default configuration (terraform-google-modules#1944)
1 parent d87cbee commit 04ebd0c

File tree

17 files changed

+111
-12
lines changed

17 files changed

+111
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ The node_pools variable takes the following parameters:
300300
| key | The key required for the taint | | Required |
301301
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
302302
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
303+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
303304
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
304305
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
305306
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |

autogen/main/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ The node_pools variable takes the following parameters:
212212
| key | The key required for the taint | | Required |
213213
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
214214
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
215+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
215216
{% if beta_cluster %}
216217
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
217218
{% endif %}

autogen/main/cluster.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,12 @@ resource "google_container_node_pool" "windows_pools" {
870870
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
871871
disk_type = lookup(each.value, "disk_type", "pd-standard")
872872

873+
dynamic "ephemeral_storage_local_ssd_config" {
874+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
875+
content {
876+
local_ssd_count = ephemeral_storage_local_ssd_config.value
877+
}
878+
}
873879
{% if beta_cluster %}
874880
dynamic "ephemeral_storage_config" {
875881
for_each = lookup(each.value, "local_ssd_ephemeral_count",0) > 0 ? [each.value.local_ssd_ephemeral_count] : []

cluster.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,12 @@ resource "google_container_node_pool" "pools" {
595595
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
596596
disk_type = lookup(each.value, "disk_type", "pd-standard")
597597

598+
dynamic "ephemeral_storage_local_ssd_config" {
599+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
600+
content {
601+
local_ssd_count = ephemeral_storage_local_ssd_config.value
602+
}
603+
}
598604

599605
dynamic "local_nvme_ssd_block_config" {
600606
for_each = lookup(each.value, "local_nvme_ssd_count", 0) > 0 ? [each.value.local_nvme_ssd_count] : []
@@ -820,6 +826,12 @@ resource "google_container_node_pool" "windows_pools" {
820826
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
821827
disk_type = lookup(each.value, "disk_type", "pd-standard")
822828

829+
dynamic "ephemeral_storage_local_ssd_config" {
830+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
831+
content {
832+
local_ssd_count = ephemeral_storage_local_ssd_config.value
833+
}
834+
}
823835

824836
dynamic "local_nvme_ssd_block_config" {
825837
for_each = lookup(each.value, "local_nvme_ssd_count", 0) > 0 ? [each.value.local_nvme_ssd_count] : []

examples/node_pool/main.tf

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,19 @@ module "gke" {
6666
service_account = var.compute_engine_service_account
6767
},
6868
{
69-
name = "pool-03"
70-
machine_type = "n1-standard-2"
71-
node_locations = "${var.region}-b,${var.region}-c"
72-
autoscaling = false
73-
node_count = 2
74-
disk_type = "pd-standard"
75-
auto_upgrade = true
76-
service_account = var.compute_engine_service_account
77-
pod_range = "test"
78-
sandbox_enabled = true
79-
cpu_manager_policy = "static"
80-
cpu_cfs_quota = true
69+
name = "pool-03"
70+
machine_type = "n1-standard-2"
71+
node_locations = "${var.region}-b,${var.region}-c"
72+
autoscaling = false
73+
node_count = 2
74+
disk_type = "pd-standard"
75+
auto_upgrade = true
76+
service_account = var.compute_engine_service_account
77+
pod_range = "test"
78+
sandbox_enabled = true
79+
cpu_manager_policy = "static"
80+
cpu_cfs_quota = true
81+
local_ssd_ephemeral_count = 2
8182
},
8283
]
8384

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ The node_pools variable takes the following parameters:
362362
| key | The key required for the taint | | Required |
363363
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
364364
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
365+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
365366
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
366367
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
367368
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,12 @@ resource "google_container_node_pool" "pools" {
756756
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
757757
disk_type = lookup(each.value, "disk_type", "pd-standard")
758758

759+
dynamic "ephemeral_storage_local_ssd_config" {
760+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
761+
content {
762+
local_ssd_count = ephemeral_storage_local_ssd_config.value
763+
}
764+
}
759765
dynamic "ephemeral_storage_config" {
760766
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
761767
content {
@@ -1007,6 +1013,12 @@ resource "google_container_node_pool" "windows_pools" {
10071013
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
10081014
disk_type = lookup(each.value, "disk_type", "pd-standard")
10091015

1016+
dynamic "ephemeral_storage_local_ssd_config" {
1017+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
1018+
content {
1019+
local_ssd_count = ephemeral_storage_local_ssd_config.value
1020+
}
1021+
}
10101022
dynamic "ephemeral_storage_config" {
10111023
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
10121024
content {

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ The node_pools variable takes the following parameters:
340340
| key | The key required for the taint | | Required |
341341
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
342342
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
343+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
343344
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
344345
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
345346
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

modules/beta-private-cluster/cluster.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,12 @@ resource "google_container_node_pool" "pools" {
680680
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
681681
disk_type = lookup(each.value, "disk_type", "pd-standard")
682682

683+
dynamic "ephemeral_storage_local_ssd_config" {
684+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
685+
content {
686+
local_ssd_count = ephemeral_storage_local_ssd_config.value
687+
}
688+
}
683689
dynamic "ephemeral_storage_config" {
684690
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
685691
content {
@@ -930,6 +936,12 @@ resource "google_container_node_pool" "windows_pools" {
930936
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
931937
disk_type = lookup(each.value, "disk_type", "pd-standard")
932938

939+
dynamic "ephemeral_storage_local_ssd_config" {
940+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
941+
content {
942+
local_ssd_count = ephemeral_storage_local_ssd_config.value
943+
}
944+
}
933945
dynamic "ephemeral_storage_config" {
934946
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
935947
content {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ The node_pools variable takes the following parameters:
349349
| key | The key required for the taint | | Required |
350350
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
351351
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
352+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
352353
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
353354
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
354355
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,12 @@ resource "google_container_node_pool" "pools" {
737737
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
738738
disk_type = lookup(each.value, "disk_type", "pd-standard")
739739

740+
dynamic "ephemeral_storage_local_ssd_config" {
741+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
742+
content {
743+
local_ssd_count = ephemeral_storage_local_ssd_config.value
744+
}
745+
}
740746
dynamic "ephemeral_storage_config" {
741747
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
742748
content {
@@ -988,6 +994,12 @@ resource "google_container_node_pool" "windows_pools" {
988994
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
989995
disk_type = lookup(each.value, "disk_type", "pd-standard")
990996

997+
dynamic "ephemeral_storage_local_ssd_config" {
998+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
999+
content {
1000+
local_ssd_count = ephemeral_storage_local_ssd_config.value
1001+
}
1002+
}
9911003
dynamic "ephemeral_storage_config" {
9921004
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
9931005
content {

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ The node_pools variable takes the following parameters:
327327
| key | The key required for the taint | | Required |
328328
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
329329
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
330+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
330331
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
331332
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
332333
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@ resource "google_container_node_pool" "pools" {
661661
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
662662
disk_type = lookup(each.value, "disk_type", "pd-standard")
663663

664+
dynamic "ephemeral_storage_local_ssd_config" {
665+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
666+
content {
667+
local_ssd_count = ephemeral_storage_local_ssd_config.value
668+
}
669+
}
664670
dynamic "ephemeral_storage_config" {
665671
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
666672
content {
@@ -911,6 +917,12 @@ resource "google_container_node_pool" "windows_pools" {
911917
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
912918
disk_type = lookup(each.value, "disk_type", "pd-standard")
913919

920+
dynamic "ephemeral_storage_local_ssd_config" {
921+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
922+
content {
923+
local_ssd_count = ephemeral_storage_local_ssd_config.value
924+
}
925+
}
914926
dynamic "ephemeral_storage_config" {
915927
for_each = lookup(each.value, "local_ssd_ephemeral_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
916928
content {

modules/private-cluster-update-variant/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
| key | The key required for the taint | | Required |
336336
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
337337
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
338+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
338339
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
339340
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
340341
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,12 @@ resource "google_container_node_pool" "pools" {
690690
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
691691
disk_type = lookup(each.value, "disk_type", "pd-standard")
692692

693+
dynamic "ephemeral_storage_local_ssd_config" {
694+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
695+
content {
696+
local_ssd_count = ephemeral_storage_local_ssd_config.value
697+
}
698+
}
693699

694700
dynamic "local_nvme_ssd_block_config" {
695701
for_each = lookup(each.value, "local_nvme_ssd_count", 0) > 0 ? [each.value.local_nvme_ssd_count] : []
@@ -916,6 +922,12 @@ resource "google_container_node_pool" "windows_pools" {
916922
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
917923
disk_type = lookup(each.value, "disk_type", "pd-standard")
918924

925+
dynamic "ephemeral_storage_local_ssd_config" {
926+
for_each = lookup(each.value, "local_ssd_ephemeral_storage_count", 0) > 0 ? [each.value.local_ssd_ephemeral_count] : []
927+
content {
928+
local_ssd_count = ephemeral_storage_local_ssd_config.value
929+
}
930+
}
919931

920932
dynamic "local_nvme_ssd_block_config" {
921933
for_each = lookup(each.value, "local_nvme_ssd_count", 0) > 0 ? [each.value.local_nvme_ssd_count] : []

modules/private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ The node_pools variable takes the following parameters:
313313
| key | The key required for the taint | | Required |
314314
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
315315
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
316+
| local_ssd_ephemeral_storage_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
316317
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
317318
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
318319
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |

0 commit comments

Comments
 (0)