From 185052df50ff82fbd6a8c0e7d5164278e46c9842 Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Fri, 31 May 2019 15:19:54 -0700 Subject: [PATCH] Use Stackdriver Kubernetes Engine Monitoring --- modules/gke-cluster/README.md | 17 +++++++++++++++++ modules/gke-cluster/variables.tf | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/modules/gke-cluster/README.md b/modules/gke-cluster/README.md index 0699f86..8e83a1b 100644 --- a/modules/gke-cluster/README.md +++ b/modules/gke-cluster/README.md @@ -96,6 +96,23 @@ region as your private cluster, can use the private endpoint. You can relax the restrictions by authorizing certain address ranges to access the endpoints with the input variable `master_authorized_networks_config`. + +### How do I configure logging and monitoring with Stackdriver for my cluster? + +Stackdriver Kubernetes Engine Monitoring is enabled by default using this module. It provides improved support for both +Stackdriver Monitoring and Stackdriver Logging in your cluster, including a GKE-customized Stackdriver Console with +fine-grained breakdown of resources including namespaces and pods. Learn more with the [official documentation](https://cloud.google.com/monitoring/kubernetes-engine/#about-skm) + +Although Stackdriver Kubernetes Engine Monitoring is enabled by default, you can use the legacy Stackdriver options by +modifying your configuration. See the [differences between GKE Stackdriver versions](https://cloud.google.com/monitoring/kubernetes-engine/#version) +for the differences between legacy Stackdriver and Stackdriver Kubernetes Engine Monitoring. + +#### How do I use Prometheus for monitoring? + +Prometheus monitoring for your cluster is ready to go through GCP's Stackdriver Kubernetes Engine Monitoring service. If +you've configured your GKE cluster with Stackdriver Kubernetes Engine Monitoring, you can follow Google's guide to +[using Prometheus](https://cloud.google.com/monitoring/kubernetes-engine/prometheus) to configure your cluster with +Prometheus. ### Private cluster restrictions and limitations diff --git a/modules/gke-cluster/variables.tf b/modules/gke-cluster/variables.tf index f9a171a..cc9a5ca 100644 --- a/modules/gke-cluster/variables.tf +++ b/modules/gke-cluster/variables.tf @@ -43,13 +43,13 @@ variable "kubernetes_version" { } variable "logging_service" { - description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none" - default = "logging.googleapis.com" + description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com/kubernetes, logging.googleapis.com (legacy), and none" + default = "logging.googleapis.com/kubernetes" } variable "monitoring_service" { - description = "The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Stackdriver 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" - default = "monitoring.googleapis.com" + description = "The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Stackdriver Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting. Available options include monitoring.googleapis.com/kubernetes, monitoring.googleapis.com (legacy), and none" + default = "monitoring.googleapis.com/kubernetes" } variable "horizontal_pod_autoscaling" {