Skip to content

gcp-k8s-stackdriver-monitor-off

Ensure Stackdriver Monitoring is set to Enabled on Kubernetes Engine Clusters

It is highly recommended to enable StackDriver Monitoring on your GKE cluster as it will allow for better integration with Google Cloud unleashing many powerful features useful for security monitoring.

Examples

Insecure Example

resource "google_container_cluster" "k8s-cluster" {
  name     = "my-gke"
  location = "us-central1"

  initial_node_count = 1

  network    = google_compute_network.vpc.name
  subnetwork = google_compute_subnetwork.subnet.name

  monitoring_service = "monitoring.googleapis.com" # Legacy monitoring
}

Secure Example

resource "google_container_cluster" "k8s-cluster" {
  name     = "my-gke"
  location = "us-central1"

  initial_node_count = 1

  network    = google_compute_network.vpc.name
  subnetwork = google_compute_subnetwork.subnet.name

  monitoring_service = "monitoring.googleapis.com/kubernetes"
}

More information