Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #86 from cabify/jt/add-tier-to-scraper-tags
Browse files Browse the repository at this point in the history
adds the tier all the way down
  • Loading branch information
tnosaj authored Feb 4, 2020
2 parents 41e474e + 31e1ad3 commit 1750752
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
11 changes: 11 additions & 0 deletions google-cloud/kubernetes/prometheus-mysql-scraper/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ variable "instance_read_only_replica_count" {
description = "Number of read only replicas to create"
default = 0
}

variable "instance_tier" {
description = "Tier to be passed on to prometheus"
type = "string"
}

variable "instance_tier_read_only_replica" {
description = "Tier to be passed on to prometheus"
type = "string"
default = "UNSET"
}
22 changes: 12 additions & 10 deletions google-cloud/kubernetes/prometheus-mysql-scraper/service.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
resource "kubernetes_service" "cloudsql" {
metadata {
annotations {
prometheus_io_scrape = "persistence"
prometheus_io_environment = "${replace("${replace(var.project,"cabify-","")}","-cloudsql-1","")}"
prometheus_io_service = "${var.service_name}"
prometheus_io_owner = "${var.owner}"
prometheus_io_tier = "${var.tier}"
prometheus_io_scrape = "persistence"
prometheus_io_environment = "${replace("${replace(var.project,"cabify-","")}","-cloudsql-1","")}"
prometheus_io_service = "${var.service_name}"
prometheus_io_owner = "${var.owner}"
prometheus_io_tier = "${var.tier}"
prometheus_io_instance_tier = "${var.instance_tier}"
}

name = "${kubernetes_replication_controller.cloudsql.metadata.0.name}"
Expand Down Expand Up @@ -33,11 +34,12 @@ resource "kubernetes_service" "cloudsql-failover" {

metadata {
annotations {
prometheus_io_scrape = "persistence"
prometheus_io_environment = "${replace(var.project,"cabify-","")}"
prometheus_io_service = "${var.service_name}"
prometheus_io_owner = "${var.owner}"
prometheus_io_tier = "${var.tier}"
prometheus_io_scrape = "persistence"
prometheus_io_environment = "${replace(var.project,"cabify-","")}"
prometheus_io_service = "${var.service_name}"
prometheus_io_owner = "${var.owner}"
prometheus_io_tier = "${var.tier}"
prometheus_io_instance_tier = "${var.instance_tier_read_only_replica == "UNSET" ? var.instance_tier : var.instance_tier_read_only_replica}"
}

name = "${element(kubernetes_replication_controller.cloudsql-failover.*.metadata.0.name, count.index)}"
Expand Down
4 changes: 3 additions & 1 deletion google-cloud/sql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ resource "google_sql_database_instance" "google_sql_database_instance-module-rea
}

module "cabify_prometheus_mysql_scraper" {
source = "[email protected]:cabify/terraform-modules.git//google-cloud/kubernetes/prometheus-mysql-scraper?ref=google-cloud_kubernetes-prometheus-mysql-scraper-v0.1.16"
source = "[email protected]:cabify/terraform-modules.git//google-cloud/kubernetes/prometheus-mysql-scraper?ref=google-cloud_kubernetes-prometheus-mysql-scraper-v0.1.17"
service_name = "${var.service_name}"
user_name = "${var.user_name}"
user_password = "${var.user_password}"
Expand All @@ -85,4 +85,6 @@ module "cabify_prometheus_mysql_scraper" {
owner = "${var.owner}"
tier = "${var.tier}"
instance_read_only_replica_count = "${var.instance_read_only_replica_count}"
instance_tier = "${var.instance_tier}"
instance_tier_read_only_replica = "${var.instance_tier_read_only_replica}"
}

0 comments on commit 1750752

Please sign in to comment.