Skip to content

Commit 13353d3

Browse files
committed
feat: add logging_config and monitoring_config to autopilot modules
1 parent 179a8ec commit 13353d3

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

modules/beta-autopilot-private-cluster/cluster.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,21 @@ resource "google_container_cluster" "primary" {
347347
}
348348
}
349349

350+
dynamic "logging_config" {
351+
for_each = length(var.logging_enabled_components) > 0 ? [1] : []
352+
353+
content {
354+
enable_components = var.logging_enabled_components
355+
}
356+
}
357+
358+
dynamic "monitoring_config" {
359+
for_each = length(var.monitoring_enabled_components) > 0 ? [1] : []
360+
content {
361+
enable_components = var.monitoring_enabled_components
362+
}
363+
}
364+
350365
node_pool_defaults {
351366
node_config_defaults {
352367
logging_variant = var.logging_variant

modules/beta-autopilot-private-cluster/variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,17 @@ variable "identity_namespace" {
313313
default = "enabled"
314314
}
315315

316+
variable "monitoring_enabled_components" {
317+
type = list(string)
318+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
319+
default = []
320+
}
321+
322+
variable "logging_enabled_components" {
323+
type = list(string)
324+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
325+
default = []
326+
}
316327

317328
variable "release_channel" {
318329
type = string

modules/beta-autopilot-public-cluster/cluster.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,21 @@ resource "google_container_cluster" "primary" {
326326
}
327327
}
328328

329+
dynamic "logging_config" {
330+
for_each = length(var.logging_enabled_components) > 0 ? [1] : []
331+
332+
content {
333+
enable_components = var.logging_enabled_components
334+
}
335+
}
336+
337+
dynamic "monitoring_config" {
338+
for_each = length(var.monitoring_enabled_components) > 0 ? [1] : []
339+
content {
340+
enable_components = var.monitoring_enabled_components
341+
}
342+
}
343+
329344
node_pool_defaults {
330345
node_config_defaults {
331346
logging_variant = var.logging_variant

modules/beta-autopilot-public-cluster/variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,17 @@ variable "identity_namespace" {
277277
default = "enabled"
278278
}
279279

280+
variable "monitoring_enabled_components" {
281+
type = list(string)
282+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
283+
default = []
284+
}
285+
286+
variable "logging_enabled_components" {
287+
type = list(string)
288+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
289+
default = []
290+
}
280291

281292
variable "release_channel" {
282293
type = string

0 commit comments

Comments
 (0)