From a7997c84d890543640cb39e96b4fe084e39b6958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Gonz=C3=A1lez=20Ruiz?= Date: Thu, 13 Dec 2018 14:16:34 +0000 Subject: [PATCH 1/2] Upgrade prometheus to 2.5.0 and add parameter to set log-level --- apps/prometheus/inputs.tf | 6 ++++++ apps/prometheus/replication-controller.tf | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/prometheus/inputs.tf b/apps/prometheus/inputs.tf index 000d4f7..06f8f5b 100644 --- a/apps/prometheus/inputs.tf +++ b/apps/prometheus/inputs.tf @@ -50,6 +50,12 @@ variable "external_url" { type = "string" } +variable "log_level" { + description = "Log level for the instance. Defaults to info." + type = "string" + default = "info" +} + variable "prometheus_io_scrape" { description = "Set it to your desired value to get prometheus scraped. By default it will be true" type = "string" diff --git a/apps/prometheus/replication-controller.tf b/apps/prometheus/replication-controller.tf index e843aea..b82b390 100644 --- a/apps/prometheus/replication-controller.tf +++ b/apps/prometheus/replication-controller.tf @@ -95,7 +95,7 @@ resource "kubernetes_replication_controller" "prometheus" { } container { - image = "prom/prometheus:v2.3.2" + image = "prom/prometheus:v2.5.0" name = "prometheus" port { @@ -132,6 +132,7 @@ resource "kubernetes_replication_controller" "prometheus" { "--storage.tsdb.path=/prometheus/", "--web.enable-lifecycle", "--web.external-url=${var.external_url}", + "--log.level=${var.log_level}" ] liveness_probe { From 66dfd5539267472632c5a97d59e2a4e976966efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Gonz=C3=A1lez=20Ruiz?= Date: Thu, 13 Dec 2018 14:19:03 +0000 Subject: [PATCH 2/2] Format the rc config file properly --- apps/prometheus/replication-controller.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/prometheus/replication-controller.tf b/apps/prometheus/replication-controller.tf index b82b390..7bd7af2 100644 --- a/apps/prometheus/replication-controller.tf +++ b/apps/prometheus/replication-controller.tf @@ -132,7 +132,7 @@ resource "kubernetes_replication_controller" "prometheus" { "--storage.tsdb.path=/prometheus/", "--web.enable-lifecycle", "--web.external-url=${var.external_url}", - "--log.level=${var.log_level}" + "--log.level=${var.log_level}", ] liveness_probe {