Commit b8d1143e authored by John Northrup's avatar John Northrup

Merge branch 'performance-node' into 'master'

Adding performance host to Ops

Closes migration#377

See merge request !371
parents 6a568a0b 4196a134
......@@ -165,6 +165,72 @@ module "gcp-tcp-lb-bastion" {
targets = ["bastion"]
}
#######################
#
# Performance
#
#######################
module "performance-lb" {
subnetwork_name = "${module.log-proxy.google_compute_subnetwork_name}"
environment = "${var.environment}"
source = "../../modules/google/monitoring-lb"
name = "monitoring-lb"
gitlab_net_zone_id = "${var.gitlab_net_zone_id}"
project = "${var.project}"
region = "${var.region}"
cert_link = "${var.log_gitlab_net_cert_link}"
service_ports = ["9090"]
url_map = "${google_compute_url_map.log.self_link}"
hosts = ["log"]
}
# ###########################################################
resource "google_compute_url_map" "performance" {
name = "${format("log-%v", var.environment)}"
default_service = "${module.log-proxy.google_compute_backend_service_iap_self_link}"
host_rule {
hosts = ["performance.gitlab.net"]
path_matcher = "performance"
}
path_matcher {
name = "performance"
default_service = "${module.log-proxy.google_compute_backend_service_iap_self_link}"
path_rule {
paths = ["/*"]
service = "${module.log-proxy.google_compute_backend_service_iap_self_link}"
}
}
}
module "performance" {
bootstrap_version = 4
chef_provision = "${var.chef_provision}"
chef_run_list = "\"role[${var.environment}-infra-performance]\""
enable_iap = true
dns_zone_name = "${var.dns_zone_name}"
environment = "${var.environment}"
oauth2_client_id = "${var.oauth2_client_id_performance}"
oauth2_client_secret = "${var.oauth2_client_secret_performance}"
machine_type = "${var.machine_types["performance"]}"
public_ports = "${var.public_ports["performance"]}"
ip_cidr_range = "${var.subnetworks["performance"]}"
name = "performance"
node_count = 1
project = "${var.project}"
region = "${var.region}"
health_check = "http"
service_port = "9090"
source = "../../modules/google/generic-sv-with-group"
tier = "inf"
service_account_email = "${var.service_account_email}"
vpc = "${module.network.self_link}"
}
##################################
#
# Bastion
......
......@@ -16,13 +16,16 @@ variable "dns_zone_name" {
variable "oauth2_client_id_log_proxy" {}
variable "oauth2_client_secret_log_proxy" {}
variable "oauth2_client_id_performance" {}
variable "oauth2_client_secret_performance" {}
variable "machine_types" {
type = "map"
default = {
"log-proxy" = "n1-standard-1"
"bastion" = "g1-small"
"log-proxy" = "n1-standard-1"
"bastion" = "g1-small"
"performance" = "n1-standard-4"
}
}
......@@ -39,8 +42,9 @@ variable "subnetworks" {
type = "map"
default = {
"logging" = "10.250.1.0/24"
"bastion" = "10.250.2.0/24"
"logging" = "10.250.1.0/24"
"bastion" = "10.250.2.0/24"
"performance" = "10.250.3.0/24"
}
}
......@@ -48,8 +52,9 @@ variable "public_ports" {
type = "map"
default = {
"log-proxy" = []
"bastion" = [22]
"log-proxy" = []
"bastion" = [22]
"performance" = [22, 80, 443]
}
}
......@@ -57,7 +62,8 @@ variable "node_count" {
type = "map"
default = {
"bastion" = 1
"bastion" = 1
"performance" = 1
}
}
......@@ -110,3 +116,7 @@ variable "tcp_lbs_bastion" {
variable "log_gitlab_net_cert_link" {
default = "projects/gitlab-ops/global/sslCertificates/log-gitlab-net"
}
variable "performance_gitlab_net_cert_link" {
default = "projects/gitlab-ops/global/sslCertificates/performance-gitlab-net"
}
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