Skip to content

Commit f135a5f

Browse files
committed
Add options to specify monitoring and logging services
Many GKE users opt to use different logging and monitoring apis (e.g. DataDog) and would like to have the option to disable StackDriver monitoring and logging.
1 parent 2cf62a0 commit f135a5f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

cluster_regional.tf

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ resource "google_container_cluster" "primary" {
3030
subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"
3131
min_master_version = "${local.kubernetes_version}"
3232

33+
logging_service = "${var.logging_service}"
34+
monitoring_service = "${var.monitoring_service}"
35+
3336
addons_config {
3437
http_load_balancing {
3538
disabled = "${var.http_load_balancing ? 0 : 1}"

cluster_zonal.tf

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ resource "google_container_cluster" "zonal_primary" {
3030
subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"
3131
min_master_version = "${local.kubernetes_version}"
3232

33+
logging_service = "${var.logging_service}"
34+
monitoring_service = "${var.monitoring_service}"
35+
3336
addons_config {
3437
http_load_balancing {
3538
disabled = "${var.http_load_balancing ? 0 : 1}"

variables.tf

+10
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,13 @@ variable "ip_masq_link_local" {
160160
description = "Whether to masquerade traffic to the link-local prefix (169.254.0.0/16)."
161161
default = "false"
162162
}
163+
164+
variable "logging_service" {
165+
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
166+
default = "logging.googleapis.com"
167+
}
168+
169+
variable "monitoring_service" {
170+
description = "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"
171+
default = "monitoring.googleapis.com"
172+
}

0 commit comments

Comments
 (0)