Skip to content

Commit f59ebe2

Browse files
committed
feat: add advanced datapath observability config option
1 parent 2beb720 commit f59ebe2

File tree

23 files changed

+182
-0
lines changed

23 files changed

+182
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ Then perform the following commands on the root folder:
186186
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
187187
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
188188
| 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 |
189+
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
190+
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
189191
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
190192
| 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 |
191193
| 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 |

autogen/main/cluster.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ resource "google_container_cluster" "primary" {
123123
managed_prometheus {
124124
enabled = var.monitoring_enable_managed_prometheus
125125
}
126+
advanced_datapath_observability_config {
127+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
128+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
129+
}
126130
}
127131
}
128132
cluster_autoscaling {

autogen/main/variables.tf.tmpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,23 @@ variable "monitoring_enable_managed_prometheus" {
721721
default = false
722722
}
723723

724+
variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
725+
type = bool
726+
description = "Whether or not the advanced datapath metrics are enabled."
727+
default = null
728+
}
729+
730+
variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
731+
type = string
732+
description = "Mode used to make advanced datapath metrics relay available."
733+
default = null
734+
validation {
735+
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
736+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
737+
}
738+
739+
}
740+
724741
variable "monitoring_enabled_components" {
725742
type = list(string)
726743
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
@@ -88,6 +88,10 @@ resource "google_container_cluster" "primary" {
8888
managed_prometheus {
8989
enabled = var.monitoring_enable_managed_prometheus
9090
}
91+
advanced_datapath_observability_config {
92+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
93+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
94+
}
9195
}
9296
}
9397
cluster_autoscaling {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ Then perform the following commands on the root folder:
237237
| 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 |
238238
| 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 |
239239
| 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 |
240+
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
241+
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
240242
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
241243
| 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 |
242244
| 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 |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
100100
managed_prometheus {
101101
enabled = var.monitoring_enable_managed_prometheus
102102
}
103+
advanced_datapath_observability_config {
104+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
105+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,23 @@ variable "monitoring_enable_managed_prometheus" {
681681
default = false
682682
}
683683

684+
variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
685+
type = bool
686+
description = "Whether or not the advanced datapath metrics are enabled."
687+
default = null
688+
}
689+
690+
variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
691+
type = string
692+
description = "Mode used to make advanced datapath metrics relay available."
693+
default = null
694+
validation {
695+
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
696+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
697+
}
698+
699+
}
700+
684701
variable "monitoring_enabled_components" {
685702
type = list(string)
686703
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
@@ -215,6 +215,8 @@ Then perform the following commands on the root folder:
215215
| 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 |
216216
| 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 |
217217
| 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 |
218+
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
219+
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
218220
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
219221
| 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 |
220222
| 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 |

modules/beta-private-cluster/cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
100100
managed_prometheus {
101101
enabled = var.monitoring_enable_managed_prometheus
102102
}
103+
advanced_datapath_observability_config {
104+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
105+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

modules/beta-private-cluster/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,23 @@ variable "monitoring_enable_managed_prometheus" {
681681
default = false
682682
}
683683

684+
variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
685+
type = bool
686+
description = "Whether or not the advanced datapath metrics are enabled."
687+
default = null
688+
}
689+
690+
variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
691+
type = string
692+
description = "Mode used to make advanced datapath metrics relay available."
693+
default = null
694+
validation {
695+
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
696+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
697+
}
698+
699+
}
700+
684701
variable "monitoring_enabled_components" {
685702
type = list(string)
686703
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
@@ -226,6 +226,8 @@ Then perform the following commands on the root folder:
226226
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
227227
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
228228
| 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 |
229+
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
230+
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
229231
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
230232
| 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 |
231233
| 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 |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
100100
managed_prometheus {
101101
enabled = var.monitoring_enable_managed_prometheus
102102
}
103+
advanced_datapath_observability_config {
104+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
105+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,23 @@ variable "monitoring_enable_managed_prometheus" {
651651
default = false
652652
}
653653

654+
variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
655+
type = bool
656+
description = "Whether or not the advanced datapath metrics are enabled."
657+
default = null
658+
}
659+
660+
variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
661+
type = string
662+
description = "Mode used to make advanced datapath metrics relay available."
663+
default = null
664+
validation {
665+
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
666+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
667+
}
668+
669+
}
670+
654671
variable "monitoring_enabled_components" {
655672
type = list(string)
656673
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
@@ -204,6 +204,8 @@ Then perform the following commands on the root folder:
204204
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
205205
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
206206
| 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 |
207+
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
208+
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
207209
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
208210
| 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 |
209211
| 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 |

modules/beta-public-cluster/cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
100100
managed_prometheus {
101101
enabled = var.monitoring_enable_managed_prometheus
102102
}
103+
advanced_datapath_observability_config {
104+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
105+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

modules/beta-public-cluster/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,23 @@ variable "monitoring_enable_managed_prometheus" {
651651
default = false
652652
}
653653

654+
variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
655+
type = bool
656+
description = "Whether or not the advanced datapath metrics are enabled."
657+
default = null
658+
}
659+
660+
variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
661+
type = string
662+
description = "Mode used to make advanced datapath metrics relay available."
663+
default = null
664+
validation {
665+
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
666+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
667+
}
668+
669+
}
670+
654671
variable "monitoring_enabled_components" {
655672
type = list(string)
656673
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
@@ -219,6 +219,8 @@ Then perform the following commands on the root folder:
219219
| 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 |
220220
| 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 |
221221
| 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 |
222+
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
223+
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
222224
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
223225
| 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 |
224226
| 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 |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ resource "google_container_cluster" "primary" {
8888
managed_prometheus {
8989
enabled = var.monitoring_enable_managed_prometheus
9090
}
91+
advanced_datapath_observability_config {
92+
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
93+
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
94+
}
9195
}
9296
}
9397
cluster_autoscaling {

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,23 @@ variable "monitoring_enable_managed_prometheus" {
645645
default = false
646646
}
647647

648+
variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
649+
type = bool
650+
description = "Whether or not the advanced datapath metrics are enabled."
651+
default = null
652+
}
653+
654+
variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
655+
type = string
656+
description = "Mode used to make advanced datapath metrics relay available."
657+
default = null
658+
validation {
659+
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
660+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
661+
}
662+
663+
}
664+
648665
variable "monitoring_enabled_components" {
649666
type = list(string)
650667
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)