Skip to content

Commit df29a7b

Browse files
committed
feat: Allow enabling observability metrics in the safer_cluster module
1 parent 19e9c0d commit df29a7b

File tree

8 files changed

+25
-2
lines changed

8 files changed

+25
-2
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ module "gke" {
108108
monitoring_service = var.monitoring_service
109109

110110
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
111+
monitoring_enable_observability_metrics = var.monitoring_enable_observability_metrics
111112

112113
// We never use the default service account for the cluster. The default
113114
// project/editor permissions can create problems if nodes were to be ever

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ variable "monitoring_enable_managed_prometheus" {
280280
default = false
281281
}
282282

283+
variable "monitoring_enable_observability_metrics" {
284+
type = bool
285+
description = "Whether or not the advanced datapath metrics are enabled."
286+
default = false
287+
}
288+
283289
variable "grant_registry_access" {
284290
type = bool
285291
description = "Grants created cluster-specific service account storage.objectViewer role."

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ For simplicity, we suggest using `roles/container.admin` and
249249
| 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 |
250250
| master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
251251
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
252+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
252253
| 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 |
253254
| name | The name of the cluster | `string` | n/a | yes |
254255
| network | The VPC network to host the cluster in | `string` | n/a | yes |

modules/safer-cluster-update-variant/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ module "gke" {
103103
logging_service = var.logging_service
104104
monitoring_service = var.monitoring_service
105105

106-
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
106+
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
107+
monitoring_enable_observability_metrics = var.monitoring_enable_observability_metrics
107108

108109
// We never use the default service account for the cluster. The default
109110
// project/editor permissions can create problems if nodes were to be ever

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ variable "monitoring_enable_managed_prometheus" {
280280
default = false
281281
}
282282

283+
variable "monitoring_enable_observability_metrics" {
284+
type = bool
285+
description = "Whether or not the advanced datapath metrics are enabled."
286+
default = false
287+
}
288+
283289
variable "grant_registry_access" {
284290
type = bool
285291
description = "Grants created cluster-specific service account storage.objectViewer role."

modules/safer-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ For simplicity, we suggest using `roles/container.admin` and
249249
| 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 |
250250
| master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
251251
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
252+
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
252253
| 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 |
253254
| name | The name of the cluster | `string` | n/a | yes |
254255
| network | The VPC network to host the cluster in | `string` | n/a | yes |

modules/safer-cluster/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ module "gke" {
103103
logging_service = var.logging_service
104104
monitoring_service = var.monitoring_service
105105

106-
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
106+
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
107+
monitoring_enable_observability_metrics = var.monitoring_enable_observability_metrics
107108

108109
// We never use the default service account for the cluster. The default
109110
// project/editor permissions can create problems if nodes were to be ever

modules/safer-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ variable "monitoring_enable_managed_prometheus" {
280280
default = false
281281
}
282282

283+
variable "monitoring_enable_observability_metrics" {
284+
type = bool
285+
description = "Whether or not the advanced datapath metrics are enabled."
286+
default = false
287+
}
288+
283289
variable "grant_registry_access" {
284290
type = bool
285291
description = "Grants created cluster-specific service account storage.objectViewer role."

0 commit comments

Comments
 (0)