Skip to content

Commit 32a8ae3

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

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
@@ -187,7 +187,9 @@ Then perform the following commands on the root folder:
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 |
189189
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
190+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
190191
| 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 |
192+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | 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 |
192194
| name | The name of the cluster (required) | `string` | n/a | yes |
193195
| 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
@@ -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+
enable_metrics = var.monitoring_enable_observability_metrics
128+
relay_mode = var.monitoring_observability_metrics_relay_mode
129+
}
126130
}
127131
}
128132
cluster_autoscaling {

autogen/main/variables.tf.tmpl

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

724+
variable "monitoring_enable_observability_metrics" {
725+
type = bool
726+
description = "Whether or not the advanced datapath metrics are enabled."
727+
default = false
728+
}
729+
730+
variable "monitoring_observability_metrics_relay_mode" {
731+
type = string
732+
description = "Mode used to make advanced datapath metrics relay available."
733+
default = null
734+
validation {
735+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
736+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
737+
}
738+
}
739+
724740
variable "monitoring_enabled_components" {
725741
type = list(string)
726742
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+
enable_metrics = var.monitoring_enable_observability_metrics
93+
relay_mode = var.monitoring_observability_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
@@ -238,7 +238,9 @@ Then perform the following commands on the root folder:
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 |
240240
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
241+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
241242
| 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 |
243+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | 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 |
243245
| name | The name of the cluster (required) | `string` | n/a | yes |
244246
| 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
@@ -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+
enable_metrics = var.monitoring_enable_observability_metrics
105+
relay_mode = var.monitoring_observability_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

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

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

684+
variable "monitoring_enable_observability_metrics" {
685+
type = bool
686+
description = "Whether or not the advanced datapath metrics are enabled."
687+
default = false
688+
}
689+
690+
variable "monitoring_observability_metrics_relay_mode" {
691+
type = string
692+
description = "Mode used to make advanced datapath metrics relay available."
693+
default = null
694+
validation {
695+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
696+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
697+
}
698+
}
699+
684700
variable "monitoring_enabled_components" {
685701
type = list(string)
686702
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
@@ -216,7 +216,9 @@ Then perform the following commands on the root folder:
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 |
218218
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
219+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
219220
| 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 |
221+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | 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 |
221223
| name | The name of the cluster (required) | `string` | n/a | yes |
222224
| 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
@@ -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+
enable_metrics = var.monitoring_enable_observability_metrics
105+
relay_mode = var.monitoring_observability_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

modules/beta-private-cluster/variables.tf

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

684+
variable "monitoring_enable_observability_metrics" {
685+
type = bool
686+
description = "Whether or not the advanced datapath metrics are enabled."
687+
default = false
688+
}
689+
690+
variable "monitoring_observability_metrics_relay_mode" {
691+
type = string
692+
description = "Mode used to make advanced datapath metrics relay available."
693+
default = null
694+
validation {
695+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
696+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
697+
}
698+
}
699+
684700
variable "monitoring_enabled_components" {
685701
type = list(string)
686702
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
@@ -227,7 +227,9 @@ Then perform the following commands on the root folder:
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 |
229229
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
230+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
230231
| 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 |
232+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | 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 |
232234
| name | The name of the cluster (required) | `string` | n/a | yes |
233235
| 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
@@ -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+
enable_metrics = var.monitoring_enable_observability_metrics
105+
relay_mode = var.monitoring_observability_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

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

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

654+
variable "monitoring_enable_observability_metrics" {
655+
type = bool
656+
description = "Whether or not the advanced datapath metrics are enabled."
657+
default = false
658+
}
659+
660+
variable "monitoring_observability_metrics_relay_mode" {
661+
type = string
662+
description = "Mode used to make advanced datapath metrics relay available."
663+
default = null
664+
validation {
665+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
666+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
667+
}
668+
}
669+
654670
variable "monitoring_enabled_components" {
655671
type = list(string)
656672
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
@@ -205,7 +205,9 @@ Then perform the following commands on the root folder:
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 |
207207
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
208+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
208209
| 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 |
210+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | 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 |
210212
| name | The name of the cluster (required) | `string` | n/a | yes |
211213
| 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
@@ -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+
enable_metrics = var.monitoring_enable_observability_metrics
105+
relay_mode = var.monitoring_observability_metrics_relay_mode
106+
}
103107
}
104108
}
105109
cluster_autoscaling {

modules/beta-public-cluster/variables.tf

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

654+
variable "monitoring_enable_observability_metrics" {
655+
type = bool
656+
description = "Whether or not the advanced datapath metrics are enabled."
657+
default = false
658+
}
659+
660+
variable "monitoring_observability_metrics_relay_mode" {
661+
type = string
662+
description = "Mode used to make advanced datapath metrics relay available."
663+
default = null
664+
validation {
665+
condition = var.monitoring_observability_metrics_relay_mode == null ? true : contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"], var.monitoring_observability_metrics_relay_mode)
666+
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
667+
}
668+
}
669+
654670
variable "monitoring_enabled_components" {
655671
type = list(string)
656672
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
@@ -220,7 +220,9 @@ Then perform the following commands on the root folder:
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 |
222222
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
223+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
223224
| 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 |
225+
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | 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 |
225227
| name | The name of the cluster (required) | `string` | n/a | yes |
226228
| 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
@@ -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+
enable_metrics = var.monitoring_enable_observability_metrics
93+
relay_mode = var.monitoring_observability_metrics_relay_mode
94+
}
9195
}
9296
}
9397
cluster_autoscaling {

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

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

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