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 |

0 commit comments

Comments
 (0)