diff --git a/apps/prometheus/outputs.tf b/apps/prometheus/outputs.tf index 2f47a6a..92ceb87 100644 --- a/apps/prometheus/outputs.tf +++ b/apps/prometheus/outputs.tf @@ -19,4 +19,4 @@ output "trickster_service_name" { output "trickster_service_port" { value = "${var.trickster_port}" -} \ No newline at end of file +} diff --git a/apps/prometheus/replication-controller.tf b/apps/prometheus/replication-controller.tf index ef972e2..c9bfabb 100644 --- a/apps/prometheus/replication-controller.tf +++ b/apps/prometheus/replication-controller.tf @@ -82,8 +82,8 @@ resource "kubernetes_replication_controller" "prometheus" { } volume { - name = "trickster-boltdb-cache" - empty_dir {} + name = "trickster-boltdb-cache" + empty_dir = {} } container { @@ -171,14 +171,16 @@ resource "kubernetes_replication_controller" "prometheus" { period_seconds = "${var.livenessprobe_period_seconds}" timeout_seconds = "${var.livenessprobe_timeout_seconds}" } + readiness_probe { http_get { path = "/-/ready" port = "${var.prometheus-port}" } - period_seconds = "${var.readinessprobe_period_seconds}" - timeout_seconds = "${var.readinessprobe_timeout_seconds}" - } + + period_seconds = "${var.readinessprobe_period_seconds}" + timeout_seconds = "${var.readinessprobe_timeout_seconds}" + } } container { @@ -205,7 +207,6 @@ resource "kubernetes_replication_controller" "prometheus" { container_port = "${var.trickster_metrics_port}" } - args = [ "--config=/etc/trickster/trickster.conf", "--proxy-port=9092", @@ -220,7 +221,6 @@ resource "kubernetes_replication_controller" "prometheus" { name = "trickster-boltdb-cache" mount_path = "/tmp/trickster/" } - } } } diff --git a/google-cloud/kubernetes/prometheus-mysql-scraper/README.md b/google-cloud/kubernetes/prometheus-mysql-scraper/README.md index 251660c..d120c5f 100644 --- a/google-cloud/kubernetes/prometheus-mysql-scraper/README.md +++ b/google-cloud/kubernetes/prometheus-mysql-scraper/README.md @@ -11,6 +11,7 @@ module "cabify_prometheus_mysql_scraper" { user_password = "${var.user_password}" instance_region = "${var.instance_region}" project = "${var.project}" + namespace = "${var.namespace}" } ``` **NOTE:** We start a [cloudsql proxy](https://github.com/GoogleCloudPlatform/cloudsql-proxy) as part of the deployment and connect the scraper to it. This proxy needs its own service account so it has `connect` privileges to the db. It connects via a string such as: `cabify-staging:us-central1:corporate-master`. This translates to to following with the variables: @@ -37,3 +38,6 @@ module "cabify_prometheus_mysql_scraper" { ### project **Description:** "Name of the gcp project" +### namespace +**Description:** "Name of the kubernetes namespace" + diff --git a/google-cloud/sql/inputs.tf b/google-cloud/sql/inputs.tf index 3cf8b6a..1de38ed 100644 --- a/google-cloud/sql/inputs.tf +++ b/google-cloud/sql/inputs.tf @@ -87,3 +87,9 @@ variable "project" { description = "Name of gcp project" type = "string" } + +variable "namespace" { + description = "Name of kubernetes namespace" + type = "string" + default = "prometheus" +} diff --git a/google-cloud/sql/main.tf b/google-cloud/sql/main.tf index 67b22a1..68049ff 100644 --- a/google-cloud/sql/main.tf +++ b/google-cloud/sql/main.tf @@ -109,4 +109,5 @@ module "cabify_prometheus_mysql_scraper" { user_password = "${var.user_password}" instance_region = "${var.instance_region}" project = "${var.project}" + namespace = "${var.namespace}" }