Skip to content

Commit 90e9bdf

Browse files
authored
feat: add advanced datapath observability config option (#1776)
1 parent b6f3560 commit 90e9bdf

File tree

23 files changed

+174
-0
lines changed

23 files changed

+174
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ Then perform the following commands on the root folder:
188188
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
189189
| 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 |
190190
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
191+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
191192
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
193+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
192194
| 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 |
193195
| name | The name of the cluster (required) | `string` | n/a | yes |
194196
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |

autogen/main/cluster.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ resource "google_container_cluster" "primary" {
125125
managed_prometheus {
126126
enabled = var.monitoring_enable_managed_prometheus
127127
}
128+
advanced_datapath_observability_config {
129+
enable_metrics = var.monitoring_enable_observability_metrics
130+
relay_mode = var.monitoring_observability_metrics_relay_mode
131+
}
128132
}
129133
}
130134
cluster_autoscaling {

autogen/main/variables.tf.tmpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,22 @@ variable "monitoring_enable_managed_prometheus" {
739739
default = false
740740
}
741741

742+
variable "monitoring_enable_observability_metrics" {
743+
type = bool
744+
description = "Whether or not the advanced datapath metrics are enabled."
745+
default = false
746+
}
747+
748+
variable "monitoring_observability_metrics_relay_mode" {
749+
type = string
750+
description = "Mode used to make advanced datapath metrics relay available."
751+
default = null
752+
validation {
753+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
754+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
755+
}
756+
}
757+
742758
variable "monitoring_enabled_components" {
743759
type = list(string)
744760
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."

cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ resource "google_container_cluster" "primary" {
9090
managed_prometheus {
9191
enabled = var.monitoring_enable_managed_prometheus
9292
}
93+
advanced_datapath_observability_config {
94+
enable_metrics = var.monitoring_enable_observability_metrics
95+
relay_mode = var.monitoring_observability_metrics_relay_mode
96+
}
9397
}
9498
}
9599
cluster_autoscaling {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ Then perform the following commands on the root folder:
239239
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
240240
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
241241
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
242+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
242243
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
244+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
243245
| 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 |
244246
| name | The name of the cluster (required) | `string` | n/a | yes |
245247
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ resource "google_container_cluster" "primary" {
102102
managed_prometheus {
103103
enabled = var.monitoring_enable_managed_prometheus
104104
}
105+
advanced_datapath_observability_config {
106+
enable_metrics = var.monitoring_enable_observability_metrics
107+
relay_mode = var.monitoring_observability_metrics_relay_mode
108+
}
105109
}
106110
}
107111
cluster_autoscaling {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,22 @@ variable "monitoring_enable_managed_prometheus" {
699699
default = false
700700
}
701701

702+
variable "monitoring_enable_observability_metrics" {
703+
type = bool
704+
description = "Whether or not the advanced datapath metrics are enabled."
705+
default = false
706+
}
707+
708+
variable "monitoring_observability_metrics_relay_mode" {
709+
type = string
710+
description = "Mode used to make advanced datapath metrics relay available."
711+
default = null
712+
validation {
713+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
714+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
715+
}
716+
}
717+
702718
variable "monitoring_enabled_components" {
703719
type = list(string)
704720
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."

modules/beta-private-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ Then perform the following commands on the root folder:
217217
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
218218
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
219219
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
220+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
220221
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
222+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
221223
| 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 |
222224
| name | The name of the cluster (required) | `string` | n/a | yes |
223225
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |

modules/beta-private-cluster/cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ resource "google_container_cluster" "primary" {
102102
managed_prometheus {
103103
enabled = var.monitoring_enable_managed_prometheus
104104
}
105+
advanced_datapath_observability_config {
106+
enable_metrics = var.monitoring_enable_observability_metrics
107+
relay_mode = var.monitoring_observability_metrics_relay_mode
108+
}
105109
}
106110
}
107111
cluster_autoscaling {

modules/beta-private-cluster/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,22 @@ variable "monitoring_enable_managed_prometheus" {
699699
default = false
700700
}
701701

702+
variable "monitoring_enable_observability_metrics" {
703+
type = bool
704+
description = "Whether or not the advanced datapath metrics are enabled."
705+
default = false
706+
}
707+
708+
variable "monitoring_observability_metrics_relay_mode" {
709+
type = string
710+
description = "Mode used to make advanced datapath metrics relay available."
711+
default = null
712+
validation {
713+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
714+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
715+
}
716+
}
717+
702718
variable "monitoring_enabled_components" {
703719
type = list(string)
704720
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ Then perform the following commands on the root folder:
228228
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
229229
| 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 |
230230
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
231+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
231232
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
233+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
232234
| 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 |
233235
| name | The name of the cluster (required) | `string` | n/a | yes |
234236
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ resource "google_container_cluster" "primary" {
102102
managed_prometheus {
103103
enabled = var.monitoring_enable_managed_prometheus
104104
}
105+
advanced_datapath_observability_config {
106+
enable_metrics = var.monitoring_enable_observability_metrics
107+
relay_mode = var.monitoring_observability_metrics_relay_mode
108+
}
105109
}
106110
}
107111
cluster_autoscaling {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,22 @@ variable "monitoring_enable_managed_prometheus" {
669669
default = false
670670
}
671671

672+
variable "monitoring_enable_observability_metrics" {
673+
type = bool
674+
description = "Whether or not the advanced datapath metrics are enabled."
675+
default = false
676+
}
677+
678+
variable "monitoring_observability_metrics_relay_mode" {
679+
type = string
680+
description = "Mode used to make advanced datapath metrics relay available."
681+
default = null
682+
validation {
683+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
684+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
685+
}
686+
}
687+
672688
variable "monitoring_enabled_components" {
673689
type = list(string)
674690
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."

modules/beta-public-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ Then perform the following commands on the root folder:
206206
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
207207
| 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 |
208208
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
209+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
209210
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
211+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
210212
| 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 |
211213
| name | The name of the cluster (required) | `string` | n/a | yes |
212214
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |

modules/beta-public-cluster/cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ resource "google_container_cluster" "primary" {
102102
managed_prometheus {
103103
enabled = var.monitoring_enable_managed_prometheus
104104
}
105+
advanced_datapath_observability_config {
106+
enable_metrics = var.monitoring_enable_observability_metrics
107+
relay_mode = var.monitoring_observability_metrics_relay_mode
108+
}
105109
}
106110
}
107111
cluster_autoscaling {

modules/beta-public-cluster/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,22 @@ variable "monitoring_enable_managed_prometheus" {
669669
default = false
670670
}
671671

672+
variable "monitoring_enable_observability_metrics" {
673+
type = bool
674+
description = "Whether or not the advanced datapath metrics are enabled."
675+
default = false
676+
}
677+
678+
variable "monitoring_observability_metrics_relay_mode" {
679+
type = string
680+
description = "Mode used to make advanced datapath metrics relay available."
681+
default = null
682+
validation {
683+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
684+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
685+
}
686+
}
687+
672688
variable "monitoring_enabled_components" {
673689
type = list(string)
674690
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ Then perform the following commands on the root folder:
221221
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
222222
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
223223
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
224+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
224225
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
226+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
225227
| 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 |
226228
| name | The name of the cluster (required) | `string` | n/a | yes |
227229
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ resource "google_container_cluster" "primary" {
9090
managed_prometheus {
9191
enabled = var.monitoring_enable_managed_prometheus
9292
}
93+
advanced_datapath_observability_config {
94+
enable_metrics = var.monitoring_enable_observability_metrics
95+
relay_mode = var.monitoring_observability_metrics_relay_mode
96+
}
9397
}
9498
}
9599
cluster_autoscaling {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,22 @@ variable "monitoring_enable_managed_prometheus" {
663663
default = false
664664
}
665665

666+
variable "monitoring_enable_observability_metrics" {
667+
type = bool
668+
description = "Whether or not the advanced datapath metrics are enabled."
669+
default = false
670+
}
671+
672+
variable "monitoring_observability_metrics_relay_mode" {
673+
type = string
674+
description = "Mode used to make advanced datapath metrics relay available."
675+
default = null
676+
validation {
677+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
678+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
679+
}
680+
}
681+
666682
variable "monitoring_enabled_components" {
667683
type = list(string)
668684
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."

0 commit comments

Comments
 (0)