From dafdd72cdb5df98f84561ed7153a098b9844ccf5 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Thu, 5 Sep 2024 16:53:33 -0700 Subject: [PATCH] fix!: update relay_mode to enable_relay (#2067) --- README.md | 2 +- autogen/main/cluster.tf.tmpl | 2 +- autogen/main/variables.tf.tmpl | 12 ++++-------- cluster.tf | 2 +- docs/upgrading_to_v33.0.md | 14 ++++++++++++++ .../beta-private-cluster-update-variant/README.md | 2 +- .../beta-private-cluster-update-variant/cluster.tf | 2 +- .../variables.tf | 12 ++++-------- modules/beta-private-cluster/README.md | 2 +- modules/beta-private-cluster/cluster.tf | 2 +- modules/beta-private-cluster/variables.tf | 12 ++++-------- .../beta-public-cluster-update-variant/README.md | 2 +- .../beta-public-cluster-update-variant/cluster.tf | 2 +- .../variables.tf | 12 ++++-------- modules/beta-public-cluster/README.md | 2 +- modules/beta-public-cluster/cluster.tf | 2 +- modules/beta-public-cluster/variables.tf | 12 ++++-------- modules/private-cluster-update-variant/README.md | 2 +- modules/private-cluster-update-variant/cluster.tf | 2 +- .../private-cluster-update-variant/variables.tf | 12 ++++-------- modules/private-cluster/README.md | 2 +- modules/private-cluster/cluster.tf | 2 +- modules/private-cluster/variables.tf | 12 ++++-------- variables.tf | 12 ++++-------- 24 files changed, 61 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 71b21d0060..6596164332 100644 --- a/README.md +++ b/README.md @@ -204,8 +204,8 @@ Then perform the following commands on the root folder: | master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 175065a9a8..37ff3b3e84 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -126,7 +126,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/autogen/main/variables.tf.tmpl b/autogen/main/variables.tf.tmpl index d678fa60e6..6341a054ab 100644 --- a/autogen/main/variables.tf.tmpl +++ b/autogen/main/variables.tf.tmpl @@ -851,14 +851,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/cluster.tf b/cluster.tf index bf913825d4..8b19c8e65c 100644 --- a/cluster.tf +++ b/cluster.tf @@ -99,7 +99,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/docs/upgrading_to_v33.0.md b/docs/upgrading_to_v33.0.md index 7ab69cac69..a105c612ac 100644 --- a/docs/upgrading_to_v33.0.md +++ b/docs/upgrading_to_v33.0.md @@ -13,3 +13,17 @@ To opt out, set `enable_private_nodes` to `false`. + enable_private_nodes = false } ``` + +### Advanced Datapath Observability Relay +The `monitoring_observability_metrics_relay_mode` parameter has been +replaced with `monitoring_enable_observability_relay`. + +```diff + module "cluster" { +- version = "~> 32.0" ++ version = "~> 33.0" + +- monitoring_observability_metrics_relay_mode = "INTERNAL_VPC_LB" ++ monitoring_enable_observability_relay = true +} +``` diff --git a/modules/beta-private-cluster-update-variant/README.md b/modules/beta-private-cluster-update-variant/README.md index d648f2c8f5..7625e7e425 100644 --- a/modules/beta-private-cluster-update-variant/README.md +++ b/modules/beta-private-cluster-update-variant/README.md @@ -252,8 +252,8 @@ Then perform the following commands on the root folder: | master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index a03e04ba55..0521db7492 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -105,7 +105,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/modules/beta-private-cluster-update-variant/variables.tf b/modules/beta-private-cluster-update-variant/variables.tf index 7941ea613b..05926d10e5 100644 --- a/modules/beta-private-cluster-update-variant/variables.tf +++ b/modules/beta-private-cluster-update-variant/variables.tf @@ -812,14 +812,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/modules/beta-private-cluster/README.md b/modules/beta-private-cluster/README.md index 0a08552513..9a279e761b 100644 --- a/modules/beta-private-cluster/README.md +++ b/modules/beta-private-cluster/README.md @@ -230,8 +230,8 @@ Then perform the following commands on the root folder: | master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 0ccdc462ae..60e0ba79d7 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -105,7 +105,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/modules/beta-private-cluster/variables.tf b/modules/beta-private-cluster/variables.tf index 7941ea613b..05926d10e5 100644 --- a/modules/beta-private-cluster/variables.tf +++ b/modules/beta-private-cluster/variables.tf @@ -812,14 +812,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/modules/beta-public-cluster-update-variant/README.md b/modules/beta-public-cluster-update-variant/README.md index c996793ae4..6e0c8408d7 100644 --- a/modules/beta-public-cluster-update-variant/README.md +++ b/modules/beta-public-cluster-update-variant/README.md @@ -241,8 +241,8 @@ Then perform the following commands on the root folder: | master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index cf9f095861..1ce2bb2425 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -105,7 +105,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/modules/beta-public-cluster-update-variant/variables.tf b/modules/beta-public-cluster-update-variant/variables.tf index 6f335b00fb..69d75ed31e 100644 --- a/modules/beta-public-cluster-update-variant/variables.tf +++ b/modules/beta-public-cluster-update-variant/variables.tf @@ -776,14 +776,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/modules/beta-public-cluster/README.md b/modules/beta-public-cluster/README.md index 61cd7ab92f..53ebcd9b1a 100644 --- a/modules/beta-public-cluster/README.md +++ b/modules/beta-public-cluster/README.md @@ -219,8 +219,8 @@ Then perform the following commands on the root folder: | master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index 5f8c5d1556..994612dfc8 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -105,7 +105,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/modules/beta-public-cluster/variables.tf b/modules/beta-public-cluster/variables.tf index 6f335b00fb..69d75ed31e 100644 --- a/modules/beta-public-cluster/variables.tf +++ b/modules/beta-public-cluster/variables.tf @@ -776,14 +776,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index a1ab6b6efb..039db40664 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -237,8 +237,8 @@ Then perform the following commands on the root folder: | master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 59c6b01da2..fed6445f6a 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -99,7 +99,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/modules/private-cluster-update-variant/variables.tf b/modules/private-cluster-update-variant/variables.tf index 2ce680c4e1..3873ff737c 100644 --- a/modules/private-cluster-update-variant/variables.tf +++ b/modules/private-cluster-update-variant/variables.tf @@ -777,14 +777,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index 6e945276bf..abe27d1a8a 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -215,8 +215,8 @@ Then perform the following commands on the root folder: | master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no | | monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no | | monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no | +| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no | | monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no | -| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no | | monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no | | name | The name of the cluster (required) | `string` | n/a | yes | | network | The VPC network to host the cluster in (required) | `string` | n/a | yes | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index e257f9b0da..9a4ec8f76f 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -99,7 +99,7 @@ resource "google_container_cluster" "primary" { } advanced_datapath_observability_config { enable_metrics = var.monitoring_enable_observability_metrics - relay_mode = var.monitoring_observability_metrics_relay_mode + enable_relay = var.monitoring_enable_observability_relay } } } diff --git a/modules/private-cluster/variables.tf b/modules/private-cluster/variables.tf index 2ce680c4e1..3873ff737c 100644 --- a/modules/private-cluster/variables.tf +++ b/modules/private-cluster/variables.tf @@ -777,14 +777,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" { diff --git a/variables.tf b/variables.tf index 8ab53f4cd8..f14763dbe0 100644 --- a/variables.tf +++ b/variables.tf @@ -741,14 +741,10 @@ variable "monitoring_enable_observability_metrics" { default = false } -variable "monitoring_observability_metrics_relay_mode" { - type = string - description = "Mode used to make advanced datapath metrics relay available." - default = null - validation { - condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode) - error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB." - } +variable "monitoring_enable_observability_relay" { + type = bool + description = "Whether or not the advanced datapath relay is enabled." + default = false } variable "monitoring_enabled_components" {