Skip to content

Commit acd2d41

Browse files
billyfossericyz
andauthored
feat: Add support for Logging Variant to enable max throughput option (#1616)
Co-authored-by: Eric Zhao <[email protected]> Co-authored-by: Eric Zhao <[email protected]>
1 parent 91467fa commit acd2d41

File tree

17 files changed

+62
-1
lines changed

17 files changed

+62
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module "gke" {
6565
image_type = "COS_CONTAINERD"
6666
enable_gcfs = false
6767
enable_gvnic = false
68+
logging_variant = "DEFAULT"
6869
auto_repair = true
6970
auto_upgrade = true
7071
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -279,6 +280,7 @@ The node_pools variable takes the following parameters:
279280
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
280281
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
281282
| key | The key required for the taint | | Required |
283+
| 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 |
282284
| 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 |
283285
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
284286
| 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ module "gke" {
111111
image_type = "COS_CONTAINERD"
112112
enable_gcfs = false
113113
enable_gvnic = false
114+
logging_variant = "DEFAULT"
114115
auto_repair = true
115116
auto_upgrade = true
116117
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -208,6 +209,7 @@ The node_pools variable takes the following parameters:
208209
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
209210
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
210211
| key | The key required for the taint | | Required |
212+
| 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 |
211213
| 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 |
212214
{% if beta_cluster %}
213215
| 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 |

autogen/main/cluster.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ resource "google_container_cluster" "primary" {
427427
lookup(local.node_pools_tags, var.node_pools[0].name, []),
428428
)
429429

430+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
431+
430432
dynamic "workload_metadata_config" {
431433
for_each = local.cluster_node_metadata_config
432434

@@ -796,6 +798,8 @@ resource "google_container_node_pool" "windows_pools" {
796798
local.node_pools_tags[each.value["name"]],
797799
)
798800

801+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
802+
799803
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
800804
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
801805
disk_type = lookup(each.value, "disk_type", "pd-standard")

cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ resource "google_container_cluster" "primary" {
305305
lookup(local.node_pools_tags, var.node_pools[0].name, []),
306306
)
307307

308+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
309+
308310
dynamic "workload_metadata_config" {
309311
for_each = local.cluster_node_metadata_config
310312

@@ -500,6 +502,8 @@ resource "google_container_node_pool" "pools" {
500502
local.node_pools_tags[each.value["name"]],
501503
)
502504

505+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
506+
503507
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
504508
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
505509
disk_type = lookup(each.value, "disk_type", "pd-standard")
@@ -686,6 +690,8 @@ resource "google_container_node_pool" "windows_pools" {
686690
local.node_pools_tags[each.value["name"]],
687691
)
688692

693+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
694+
689695
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
690696
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
691697
disk_type = lookup(each.value, "disk_type", "pd-standard")

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module "gke" {
9797
image_type = "COS_CONTAINERD"
9898
enable_gcfs = false
9999
enable_gvnic = false
100+
logging_variant = "DEFAULT"
100101
auto_repair = true
101102
auto_upgrade = true
102103
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -344,6 +345,7 @@ The node_pools variable takes the following parameters:
344345
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
345346
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
346347
| key | The key required for the taint | | Required |
348+
| 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 |
347349
| 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 |
348350
| 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 |
349351
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" {
362362
lookup(local.node_pools_tags, var.node_pools[0].name, []),
363363
)
364364

365+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
366+
365367
dynamic "workload_metadata_config" {
366368
for_each = local.cluster_node_metadata_config
367369

@@ -692,6 +694,8 @@ resource "google_container_node_pool" "pools" {
692694
local.node_pools_tags[each.value["name"]],
693695
)
694696

697+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
698+
695699
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
696700
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
697701
disk_type = lookup(each.value, "disk_type", "pd-standard")
@@ -918,6 +922,8 @@ resource "google_container_node_pool" "windows_pools" {
918922
local.node_pools_tags[each.value["name"]],
919923
)
920924

925+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
926+
921927
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
922928
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
923929
disk_type = lookup(each.value, "disk_type", "pd-standard")

modules/beta-private-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module "gke" {
7575
image_type = "COS_CONTAINERD"
7676
enable_gcfs = false
7777
enable_gvnic = false
78+
logging_variant = "DEFAULT"
7879
auto_repair = true
7980
auto_upgrade = true
8081
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -322,6 +323,7 @@ The node_pools variable takes the following parameters:
322323
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
323324
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
324325
| key | The key required for the taint | | Required |
326+
| 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 |
325327
| 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 |
326328
| 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 |
327329
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

modules/beta-private-cluster/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" {
362362
lookup(local.node_pools_tags, var.node_pools[0].name, []),
363363
)
364364

365+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
366+
365367
dynamic "workload_metadata_config" {
366368
for_each = local.cluster_node_metadata_config
367369

@@ -598,6 +600,8 @@ resource "google_container_node_pool" "pools" {
598600
local.node_pools_tags[each.value["name"]],
599601
)
600602

603+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
604+
601605
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
602606
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
603607
disk_type = lookup(each.value, "disk_type", "pd-standard")
@@ -823,6 +827,8 @@ resource "google_container_node_pool" "windows_pools" {
823827
local.node_pools_tags[each.value["name"]],
824828
)
825829

830+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
831+
826832
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
827833
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
828834
disk_type = lookup(each.value, "disk_type", "pd-standard")

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ module "gke" {
9191
image_type = "COS_CONTAINERD"
9292
enable_gcfs = false
9393
enable_gvnic = false
94+
logging_variant = "DEFAULT"
9495
auto_repair = true
9596
auto_upgrade = true
9697
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -331,6 +332,7 @@ The node_pools variable takes the following parameters:
331332
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
332333
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
333334
| key | The key required for the taint | | Required |
335+
| 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 |
334336
| 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 |
335337
| 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 |
336338
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" {
362362
lookup(local.node_pools_tags, var.node_pools[0].name, []),
363363
)
364364

365+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
366+
365367
dynamic "workload_metadata_config" {
366368
for_each = local.cluster_node_metadata_config
367369

@@ -673,6 +675,8 @@ resource "google_container_node_pool" "pools" {
673675
local.node_pools_tags[each.value["name"]],
674676
)
675677

678+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
679+
676680
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
677681
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
678682
disk_type = lookup(each.value, "disk_type", "pd-standard")
@@ -899,6 +903,8 @@ resource "google_container_node_pool" "windows_pools" {
899903
local.node_pools_tags[each.value["name"]],
900904
)
901905

906+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
907+
902908
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
903909
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
904910
disk_type = lookup(each.value, "disk_type", "pd-standard")

modules/beta-public-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module "gke" {
6969
image_type = "COS_CONTAINERD"
7070
enable_gcfs = false
7171
enable_gvnic = false
72+
logging_variant = "DEFAULT"
7273
auto_repair = true
7374
auto_upgrade = true
7475
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -309,6 +310,7 @@ The node_pools variable takes the following parameters:
309310
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
310311
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
311312
| key | The key required for the taint | | Required |
313+
| 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 |
312314
| 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 |
313315
| 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 |
314316
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" {
362362
lookup(local.node_pools_tags, var.node_pools[0].name, []),
363363
)
364364

365+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
366+
365367
dynamic "workload_metadata_config" {
366368
for_each = local.cluster_node_metadata_config
367369

@@ -579,6 +581,8 @@ resource "google_container_node_pool" "pools" {
579581
local.node_pools_tags[each.value["name"]],
580582
)
581583

584+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
585+
582586
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
583587
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
584588
disk_type = lookup(each.value, "disk_type", "pd-standard")
@@ -804,6 +808,8 @@ resource "google_container_node_pool" "windows_pools" {
804808
local.node_pools_tags[each.value["name"]],
805809
)
806810

811+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
812+
807813
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
808814
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
809815
disk_type = lookup(each.value, "disk_type", "pd-standard")

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ module "gke" {
9393
image_type = "COS_CONTAINERD"
9494
enable_gcfs = false
9595
enable_gvnic = false
96+
logging_variant = "DEFAULT"
9697
auto_repair = true
9798
auto_upgrade = true
9899
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -314,6 +315,7 @@ The node_pools variable takes the following parameters:
314315
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
315316
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
316317
| key | The key required for the taint | | Required |
318+
| 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 |
317319
| 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 |
318320
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
319321
| 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ resource "google_container_cluster" "primary" {
305305
lookup(local.node_pools_tags, var.node_pools[0].name, []),
306306
)
307307

308+
logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")
309+
308310
dynamic "workload_metadata_config" {
309311
for_each = local.cluster_node_metadata_config
310312

@@ -613,6 +615,8 @@ resource "google_container_node_pool" "pools" {
613615
local.node_pools_tags[each.value["name"]],
614616
)
615617

618+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
619+
616620
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
617621
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
618622
disk_type = lookup(each.value, "disk_type", "pd-standard")
@@ -800,6 +804,8 @@ resource "google_container_node_pool" "windows_pools" {
800804
local.node_pools_tags[each.value["name"]],
801805
)
802806

807+
logging_variant = lookup(each.value, "logging_variant", "DEFAULT")
808+
803809
local_ssd_count = lookup(each.value, "local_ssd_count", 0)
804810
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
805811
disk_type = lookup(each.value, "disk_type", "pd-standard")

modules/private-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module "gke" {
7171
image_type = "COS_CONTAINERD"
7272
enable_gcfs = false
7373
enable_gvnic = false
74+
logging_variant = "DEFAULT"
7475
auto_repair = true
7576
auto_upgrade = true
7677
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -292,6 +293,7 @@ The node_pools variable takes the following parameters:
292293
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
293294
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
294295
| key | The key required for the taint | | Required |
296+
| 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 |
295297
| 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 |
296298
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
297299
| 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)