Skip to content

Commit 15b472f

Browse files
authored
feat(safer-clusters): add components selection for monitoring (#1851)
1 parent 19e9c0d commit 15b472f

File tree

23 files changed

+38
-15
lines changed

23 files changed

+38
-15
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Then perform the following commands on the root folder:
192192
| 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 |
193193
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
194194
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
195-
| 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 |
195+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
196196
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
197197
| 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 |
198198
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: autogen/main/variables.tf.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ variable "monitoring_observability_metrics_relay_mode" {
762762

763763
variable "monitoring_enabled_components" {
764764
type = list(string)
765-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
765+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
766766
default = []
767767
}
768768

Diff for: autogen/safer-cluster/main.tf.tmpl

+1
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_enabled_components = var.monitoring_enabled_components
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

Diff for: autogen/safer-cluster/variables.tf.tmpl

+6
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_enabled_components" {
284+
type = list(string)
285+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
286+
default = []
287+
}
288+
283289
variable "grant_registry_access" {
284290
type = bool
285291
description = "Grants created cluster-specific service account storage.objectViewer role."

Diff for: modules/beta-private-cluster-update-variant/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Then perform the following commands on the root folder:
242242
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
243243
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
244244
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
245-
| 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 |
245+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
246246
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
247247
| 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 |
248248
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: modules/beta-private-cluster-update-variant/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ variable "monitoring_observability_metrics_relay_mode" {
724724

725725
variable "monitoring_enabled_components" {
726726
type = list(string)
727-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
727+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
728728
default = []
729729
}
730730

Diff for: modules/beta-private-cluster/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Then perform the following commands on the root folder:
220220
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
221221
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
222222
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
223-
| 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 |
223+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
224224
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
225225
| 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 |
226226
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: modules/beta-private-cluster/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ variable "monitoring_observability_metrics_relay_mode" {
724724

725725
variable "monitoring_enabled_components" {
726726
type = list(string)
727-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
727+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
728728
default = []
729729
}
730730

Diff for: modules/beta-public-cluster-update-variant/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Then perform the following commands on the root folder:
231231
| 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 |
232232
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
233233
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
234-
| 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 |
234+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
235235
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
236236
| 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 |
237237
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: modules/beta-public-cluster-update-variant/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ variable "monitoring_observability_metrics_relay_mode" {
694694

695695
variable "monitoring_enabled_components" {
696696
type = list(string)
697-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
697+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
698698
default = []
699699
}
700700

Diff for: modules/beta-public-cluster/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Then perform the following commands on the root folder:
209209
| 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 |
210210
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
211211
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
212-
| 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 |
212+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
213213
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
214214
| 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 |
215215
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: modules/beta-public-cluster/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ variable "monitoring_observability_metrics_relay_mode" {
694694

695695
variable "monitoring_enabled_components" {
696696
type = list(string)
697-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
697+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
698698
default = []
699699
}
700700

Diff for: modules/private-cluster-update-variant/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Then perform the following commands on the root folder:
225225
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
226226
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
227227
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
228-
| 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 |
228+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
229229
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
230230
| 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 |
231231
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: modules/private-cluster-update-variant/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ variable "monitoring_observability_metrics_relay_mode" {
700700

701701
variable "monitoring_enabled_components" {
702702
type = list(string)
703-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
703+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
704704
default = []
705705
}
706706

Diff for: modules/private-cluster/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Then perform the following commands on the root folder:
203203
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
204204
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
205205
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
206-
| 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 |
206+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
207207
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
208208
| 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 |
209209
| name | The name of the cluster (required) | `string` | n/a | yes |

Diff for: modules/private-cluster/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ variable "monitoring_observability_metrics_relay_mode" {
700700

701701
variable "monitoring_enabled_components" {
702702
type = list(string)
703-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
703+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
704704
default = []
705705
}
706706

Diff for: modules/safer-cluster-update-variant/README.md

+1
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\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | 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 |

Diff for: modules/safer-cluster-update-variant/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ module "gke" {
104104
monitoring_service = var.monitoring_service
105105

106106
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
107+
monitoring_enabled_components = var.monitoring_enabled_components
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

Diff for: modules/safer-cluster-update-variant/variables.tf

+6
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_enabled_components" {
284+
type = list(string)
285+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
286+
default = []
287+
}
288+
283289
variable "grant_registry_access" {
284290
type = bool
285291
description = "Grants created cluster-specific service account storage.objectViewer role."

Diff for: modules/safer-cluster/README.md

+1
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\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | 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 |

Diff for: modules/safer-cluster/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ module "gke" {
104104
monitoring_service = var.monitoring_service
105105

106106
monitoring_enable_managed_prometheus = var.monitoring_enable_managed_prometheus
107+
monitoring_enabled_components = var.monitoring_enabled_components
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

Diff for: modules/safer-cluster/variables.tf

+6
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_enabled_components" {
284+
type = list(string)
285+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
286+
default = []
287+
}
288+
283289
variable "grant_registry_access" {
284290
type = bool
285291
description = "Grants created cluster-specific service account storage.objectViewer role."

Diff for: variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ variable "monitoring_observability_metrics_relay_mode" {
670670

671671
variable "monitoring_enabled_components" {
672672
type = list(string)
673-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
673+
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
674674
default = []
675675
}
676676

0 commit comments

Comments
 (0)