Commit fad9d808 authored by John Jarvis's avatar John Jarvis Committed by John Northrup

Add gprd stackdriver exporter vm.

parent f63a39f2
......@@ -967,6 +967,28 @@ module "alerts" {
service_account_email = "${var.service_account_email}"
}
module "sd-exporter" {
bootstrap_version = 5
chef_provision = "${var.chef_provision}"
chef_run_list = "\"role[${var.environment}-infra-sd-exporter]\""
dns_zone_name = "${var.dns_zone_name}"
environment = "${var.environment}"
subnetwork_name = "${google_compute_subnetwork.monitoring.name}"
machine_type = "${var.machine_types["sd-exporter"]}"
name = "sd-exporter"
node_count = "${var.node_count["sd-exporter"]}"
project = "${var.project}"
public_ports = "${var.public_ports["sd-exporter"]}"
region = "${var.region}"
service_account_email = "${var.service_account_email}"
source = "../../modules/google/generic-sv-with-group"
tier = "inf"
create_backend_service = false
vpc = "${module.network.self_link}"
allow_stopping_for_update = true
additional_scopes = ["https://www.googleapis.com/auth/monitoring"]
}
##################################
#
# Console
......
......@@ -162,6 +162,7 @@ variable "public_ports" {
"redis-cache" = []
"registry" = []
"sidekiq" = []
"sd-exporter" = []
"stor" = []
"web" = []
"monitoring" = []
......@@ -229,6 +230,7 @@ variable "machine_types" {
"redis-cache-sentinel" = "n1-standard-1"
"registry" = "n1-standard-2"
"runner" = "n1-standard-2"
"sd-exporter" = "n1-standard-1"
"sidekiq-asap" = "n1-standard-8"
"sidekiq-besteffort" = "n1-standard-8"
"sidekiq-elasticsearch" = "n1-standard-8"
......@@ -268,6 +270,7 @@ variable "node_count" {
"registry" = 2
"runner" = 1
"share" = 1
"sd-exporter" = 1
"sidekiq-asap" = 5
"sidekiq-besteffort" = 6
"sidekiq-elasticsearch" = 0
......
......@@ -947,6 +947,28 @@ module "alerts" {
tier = "inf"
}
module "sd-exporter" {
bootstrap_version = 5
chef_provision = "${var.chef_provision}"
chef_run_list = "\"role[${var.environment}-infra-sd-exporter]\""
dns_zone_name = "${var.dns_zone_name}"
environment = "${var.environment}"
subnetwork_name = "${google_compute_subnetwork.monitoring.name}"
machine_type = "${var.machine_types["sd-exporter"]}"
name = "sd-exporter"
node_count = "${var.node_count["sd-exporter"]}"
project = "${var.project}"
public_ports = "${var.public_ports["sd-exporter"]}"
region = "${var.region}"
service_account_email = "${var.service_account_email}"
source = "../../modules/google/generic-sv-with-group"
tier = "inf"
create_backend_service = false
vpc = "${module.network.self_link}"
allow_stopping_for_update = true
additional_scopes = ["https://www.googleapis.com/auth/monitoring"]
}
##################################
#
# Console
......
......@@ -159,6 +159,7 @@ variable "public_ports" {
"redis-cache" = []
"registry" = []
"sidekiq" = []
"sd-exporter" = []
"stor" = []
"web" = []
"monitoring" = []
......@@ -226,6 +227,7 @@ variable "machine_types" {
"redis-cache" = "n1-standard-4"
"redis-cache-sentinel" = "n1-standard-1"
"registry" = "n1-standard-2"
"sd-exporter" = "n1-standard-1"
"sidekiq-asap" = "n1-standard-8"
"sidekiq-besteffort" = "n1-standard-8"
"sidekiq-elasticsearch" = "n1-standard-8"
......@@ -265,6 +267,7 @@ variable "node_count" {
"redis-cache" = 3
"redis-cache-sentinel" = 3
"registry" = 1
"sd-exporter" = 1
"share" = 1
"sidekiq-asap" = 1
"sidekiq-besteffort" = 3
......
......@@ -137,21 +137,8 @@ resource "google_compute_instance" "default" {
service_account {
// this should be the instance under which the instance should be running, rather than the one creating it...
email = "${var.service_account_email}"
// all the defaults plus cloudkms to access kms
scopes = [
"https://www.googleapis.com/auth/cloud.useraccounts.readonly",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write",
"https://www.googleapis.com/auth/pubsub",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/trace.append",
"https://www.googleapis.com/auth/cloudkms",
"https://www.googleapis.com/auth/compute.readonly",
]
email = "${var.service_account_email}"
scopes = "${concat(var.default_scopes, var.additional_scopes)}"
}
scheduling {
......@@ -174,7 +161,7 @@ resource "google_compute_instance" "default" {
}
network_interface {
subnetwork = "${google_compute_subnetwork.subnetwork.name}"
subnetwork = "${var.subnetwork_name != "" ? var.subnetwork_name : join("", google_compute_subnetwork.subnetwork.*.name) }"
access_config = {}
}
......
resource "google_compute_subnetwork" "subnetwork" {
count = "${var.node_count > 0 ? 1 : 0}"
count = "${var.subnetwork_name == "" ? 1 : 0}"
name = "${format("%v-%v", var.name, var.environment)}"
network = "${var.vpc}"
project = "${var.project}"
......
variable "default_scopes" {
type = "list"
default = [
"https://www.googleapis.com/auth/cloud.useraccounts.readonly",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write",
"https://www.googleapis.com/auth/pubsub",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/trace.append",
"https://www.googleapis.com/auth/cloudkms",
"https://www.googleapis.com/auth/compute.readonly",
]
description = "default permission scopes."
}
variable "additional_scopes" {
type = "list"
default = []
description = "Additional permission scopes."
}
variable "create_backend_service" {
default = true
}
......@@ -27,12 +52,20 @@ variable "health_check" {
default = "http"
}
variable "service_port" {}
variable "service_port" {
default = "80"
}
variable "service_path" {
default = "/"
}
variable "subnetwork_name" {
type = "string"
default = ""
description = "subnetwork name for the instances"
}
variable "block_project_ssh_keys" {
type = "string"
description = "Whether to block project level SSH keys"
......@@ -94,6 +127,7 @@ variable "log_disk_type" {
variable "ip_cidr_range" {
type = "string"
description = "The IP range"
default = "169.254.0.1/32"
}
variable "machine_type" {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment