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")

0 commit comments

Comments
 (0)