Skip to content

Commit 55faaf5

Browse files
authored
feat: Support managed Prometheus for safer cluster variants (#1311)
1 parent 568c824 commit 55faaf5

File tree

8 files changed

+26
-0
lines changed

8 files changed

+26
-0
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ module "gke" {
100100
logging_service = var.logging_service
101101
monitoring_service = var.monitoring_service
102102

103+
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
104+
103105
// We never use the default service account for the cluster. The default
104106
// project/editor permissions can create problems if nodes were to be ever
105107
// compromised.

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ variable "monitoring_service" {
226226
default = "monitoring.googleapis.com/kubernetes"
227227
}
228228

229+
variable "monitoring_enable_managed_prometheus" {
230+
type = bool
231+
description = "(Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled."
232+
default = false
233+
}
234+
229235
variable "grant_registry_access" {
230236
type = bool
231237
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
@@ -240,6 +240,7 @@ For simplicity, we suggest using `roles/container.admin` and
240240
| maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
241241
| 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 |
242242
| master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
243+
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
243244
| 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 |
244245
| name | The name of the cluster | `string` | n/a | yes |
245246
| network | The VPC network to host the cluster in | `string` | n/a | yes |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ module "gke" {
9696
logging_service = var.logging_service
9797
monitoring_service = var.monitoring_service
9898

99+
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
100+
99101
// We never use the default service account for the cluster. The default
100102
// project/editor permissions can create problems if nodes were to be ever
101103
// compromised.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ variable "monitoring_service" {
226226
default = "monitoring.googleapis.com/kubernetes"
227227
}
228228

229+
variable "monitoring_enable_managed_prometheus" {
230+
type = bool
231+
description = "(Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled."
232+
default = false
233+
}
234+
229235
variable "grant_registry_access" {
230236
type = bool
231237
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
@@ -240,6 +240,7 @@ For simplicity, we suggest using `roles/container.admin` and
240240
| maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
241241
| 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 |
242242
| master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
243+
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
243244
| 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 |
244245
| name | The name of the cluster | `string` | n/a | yes |
245246
| network | The VPC network to host the cluster in | `string` | n/a | yes |

modules/safer-cluster/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ module "gke" {
9696
logging_service = var.logging_service
9797
monitoring_service = var.monitoring_service
9898

99+
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
100+
99101
// We never use the default service account for the cluster. The default
100102
// project/editor permissions can create problems if nodes were to be ever
101103
// compromised.

modules/safer-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ variable "monitoring_service" {
226226
default = "monitoring.googleapis.com/kubernetes"
227227
}
228228

229+
variable "monitoring_enable_managed_prometheus" {
230+
type = bool
231+
description = "(Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled."
232+
default = false
233+
}
234+
229235
variable "grant_registry_access" {
230236
type = bool
231237
description = "Grants created cluster-specific service account storage.objectViewer role."

0 commit comments

Comments
 (0)