diff --git a/README.md b/README.md index 01be7adf6..45881e57f 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -279,6 +280,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | 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 | diff --git a/autogen/main/README.md b/autogen/main/README.md index c641296d6..4283fc896 100644 --- a/autogen/main/README.md +++ b/autogen/main/README.md @@ -111,6 +111,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -208,6 +209,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | {% if beta_cluster %} | 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 | diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index efa4cea50..6312993cb 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -427,6 +427,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -796,6 +798,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/cluster.tf b/cluster.tf index a8fd5d7d1..5767bce6d 100644 --- a/cluster.tf +++ b/cluster.tf @@ -305,6 +305,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -500,6 +502,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -686,6 +690,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/modules/beta-private-cluster-update-variant/README.md b/modules/beta-private-cluster-update-variant/README.md index 936e0018c..e9aed6200 100644 --- a/modules/beta-private-cluster-update-variant/README.md +++ b/modules/beta-private-cluster-update-variant/README.md @@ -97,6 +97,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -344,6 +345,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index e1132720e..0234c223f 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -692,6 +694,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -918,6 +922,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/modules/beta-private-cluster/README.md b/modules/beta-private-cluster/README.md index c424a77ad..f47073bec 100644 --- a/modules/beta-private-cluster/README.md +++ b/modules/beta-private-cluster/README.md @@ -75,6 +75,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -322,6 +323,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index a5b45f882..02c6f3fca 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -598,6 +600,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -823,6 +827,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/modules/beta-public-cluster-update-variant/README.md b/modules/beta-public-cluster-update-variant/README.md index 461a30f0c..2ea2d6489 100644 --- a/modules/beta-public-cluster-update-variant/README.md +++ b/modules/beta-public-cluster-update-variant/README.md @@ -91,6 +91,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -331,6 +332,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index db27e34d1..43b03300d 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -673,6 +675,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -899,6 +903,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/modules/beta-public-cluster/README.md b/modules/beta-public-cluster/README.md index 25cc3549e..eee034981 100644 --- a/modules/beta-public-cluster/README.md +++ b/modules/beta-public-cluster/README.md @@ -69,6 +69,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -309,6 +310,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index b37e1020e..1183a20d1 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -362,6 +362,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -579,6 +581,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -804,6 +808,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index 6f8dde0f5..0eea714f7 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -93,6 +93,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -314,6 +315,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | 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 | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index d16fda5fb..a6bcda84e 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -305,6 +305,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -613,6 +615,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -800,6 +804,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index 7c73067c9..edbe5304d 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -71,6 +71,7 @@ module "gke" { image_type = "COS_CONTAINERD" enable_gcfs = false enable_gvnic = false + logging_variant = "DEFAULT" auto_repair = true auto_upgrade = true service_account = "project-service-account@.iam.gserviceaccount.com" @@ -292,6 +293,7 @@ The node_pools variable takes the following parameters: | 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 | | 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 | | key | The key required for the taint | | Required | +| 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 | | 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 | | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | 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 | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index c10084dd4..9b3b5217e 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -305,6 +305,8 @@ resource "google_container_cluster" "primary" { lookup(local.node_pools_tags, var.node_pools[0].name, []), ) + logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT") + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -519,6 +521,8 @@ resource "google_container_node_pool" "pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") @@ -705,6 +709,8 @@ resource "google_container_node_pool" "windows_pools" { local.node_pools_tags[each.value["name"]], ) + logging_variant = lookup(each.value, "logging_variant", "DEFAULT") + local_ssd_count = lookup(each.value, "local_ssd_count", 0) disk_size_gb = lookup(each.value, "disk_size_gb", 100) disk_type = lookup(each.value, "disk_type", "pd-standard") diff --git a/test/integration/beta_cluster/beta_cluster_test.go b/test/integration/beta_cluster/beta_cluster_test.go index 7a2058816..8032a5095 100755 --- a/test/integration/beta_cluster/beta_cluster_test.go +++ b/test/integration/beta_cluster/beta_cluster_test.go @@ -36,7 +36,6 @@ func TestBetaCluster(t *testing.T) { location := gke.GetStringOutput("location") clusterName := gke.GetStringOutput("cluster_name") serviceAccount := gke.GetStringOutput("service_account") - gcloud.Runf(t, "config set project %s", projectId) op := gcloud.Runf(t, "beta container clusters describe %s --zone %s --project %s", clusterName, location, projectId) // save output as goldenfile g := golden.NewOrUpdate(t, op.String(),