Commit a5a29081 authored by Ahmad Sherif's avatar Ahmad Sherif

Add a dedicated LB for registry

parent 2af88e63
......@@ -34,6 +34,11 @@ variable "lb_fqdns_altssh" {
default = ["altssh.gprd.gitlab.com"]
}
variable "lb_fqdns_registry" {
type = "list"
default = ["test-registry.gitlab.com"]
}
variable "lb_fqdns_pages" {
type = "list"
default = ["*.pages.gprd.gitlab.io"]
......@@ -100,6 +105,16 @@ variable "tcp_lbs_altssh" {
}
}
variable "tcp_lbs_registry" {
type = "map"
default = {
"names" = ["http", "https"]
"forwarding_port_ranges" = ["80", "443"]
"health_check_ports" = ["8001", "8002"]
}
}
variable "tcp_lbs_bastion" {
type = "map"
......@@ -282,6 +297,7 @@ variable "node_count" {
"fe-lb" = 9
"fe-lb-altssh" = 2
"fe-lb-pages" = 2
"fe-lb-registry" = 2
"geodb" = 1
"git" = 16
"mailroom" = 2
......@@ -317,29 +333,30 @@ variable "subnetworks" {
type = "map"
default = {
"fe-lb" = "10.216.1.0/24"
"fe-lb-pages" = "10.216.2.0/24"
"fe-lb-altssh" = "10.216.3.0/24"
"bastion" = "10.216.4.0/24"
"db" = "10.217.1.0/24"
"redis" = "10.217.2.0/24"
"pgb" = "10.217.4.0/24"
"redis-cache" = "10.217.5.0/24"
"geodb" = "10.217.6.0/24"
"consul" = "10.218.1.0/24"
"deploy" = "10.218.3.0/24"
"runner" = "10.218.4.0/24"
"console" = "10.218.5.0/24"
"monitoring" = "10.219.1.0/24"
"pubsubbeat" = "10.219.2.0/24"
"registry" = "10.220.10.0/23"
"mailroom" = "10.220.14.0/23"
"api" = "10.220.2.0/23"
"git" = "10.220.4.0/23"
"sidekiq" = "10.220.6.0/23"
"web" = "10.220.8.0/23"
"stor" = "10.221.2.0/23"
"influxdb" = "10.219.3.0/24"
"fe-lb" = "10.216.1.0/24"
"fe-lb-pages" = "10.216.2.0/24"
"fe-lb-altssh" = "10.216.3.0/24"
"fe-lb-registry" = "10.216.5.0/24"
"bastion" = "10.216.4.0/24"
"db" = "10.217.1.0/24"
"redis" = "10.217.2.0/24"
"pgb" = "10.217.4.0/24"
"redis-cache" = "10.217.5.0/24"
"geodb" = "10.217.6.0/24"
"consul" = "10.218.1.0/24"
"deploy" = "10.218.3.0/24"
"runner" = "10.218.4.0/24"
"console" = "10.218.5.0/24"
"monitoring" = "10.219.1.0/24"
"pubsubbeat" = "10.219.2.0/24"
"registry" = "10.220.10.0/23"
"mailroom" = "10.220.14.0/23"
"api" = "10.220.2.0/23"
"git" = "10.220.4.0/23"
"sidekiq" = "10.220.6.0/23"
"web" = "10.220.8.0/23"
"stor" = "10.221.2.0/23"
"influxdb" = "10.219.3.0/24"
###############################
# These will eventually (tm) be
......
......@@ -61,6 +61,11 @@ variable "lb_fqdns_altssh" {
default = ["altssh.gstg.gitlab.com"]
}
variable "lb_fqdns_registry" {
type = "list"
default = ["test-registry.staging.gitlab.com"]
}
variable "lb_fqdns_pages" {
type = "list"
default = ["*.pages.gstg.gitlab.io"]
......@@ -127,6 +132,16 @@ variable "tcp_lbs_altssh" {
}
}
variable "tcp_lbs_registry" {
type = "map"
default = {
"names" = ["http", "https"]
"forwarding_port_ranges" = ["80", "443"]
"health_check_ports" = ["8001", "8002"]
}
}
variable "tcp_lbs_bastion" {
type = "map"
......@@ -282,6 +297,7 @@ variable "node_count" {
"fe-lb" = 3
"fe-lb-pages" = 2
"fe-lb-altssh" = 2
"fe-lb-registry" = 2
"geodb" = 1
"git" = 1
"mailroom" = 1
......@@ -316,30 +332,31 @@ variable "subnetworks" {
type = "map"
default = {
"api" = "10.224.12.0/24"
"bastion" = "10.224.20.0/24"
"console" = "10.224.21.0/24"
"consul" = "10.224.4.0/24"
"db" = "10.224.6.0/24"
"dbteam" = "10.224.22.0/24"
"deploy" = "10.224.15.0/24"
"fe-lb" = "10.224.14.0/24"
"fe-lb-altssh" = "10.224.19.0/24"
"fe-lb-pages" = "10.224.18.0/24"
"geodb" = "10.224.17.0/24"
"git" = "10.224.13.0/24"
"influxdb" = "10.226.3.0/24"
"mailroom" = "10.224.11.0/24"
"monitoring" = "10.226.1.0/24"
"pgb" = "10.224.9.0/24"
"pubsubbeat" = "10.226.2.0/24"
"redis" = "10.224.7.0/24"
"redis-cache" = "10.224.8.0/24"
"registry" = "10.224.10.0/24"
"runner" = "10.224.16.0/24"
"sidekiq" = "10.225.1.0/24"
"stor" = "10.224.2.0/23"
"web" = "10.224.1.0/24"
"api" = "10.224.12.0/24"
"bastion" = "10.224.20.0/24"
"console" = "10.224.21.0/24"
"consul" = "10.224.4.0/24"
"db" = "10.224.6.0/24"
"dbteam" = "10.224.22.0/24"
"deploy" = "10.224.15.0/24"
"fe-lb" = "10.224.14.0/24"
"fe-lb-altssh" = "10.224.19.0/24"
"fe-lb-pages" = "10.224.18.0/24"
"fe-lb-registry" = "10.224.23.0/24"
"geodb" = "10.224.17.0/24"
"git" = "10.224.13.0/24"
"influxdb" = "10.226.3.0/24"
"mailroom" = "10.224.11.0/24"
"monitoring" = "10.226.1.0/24"
"pgb" = "10.224.9.0/24"
"pubsubbeat" = "10.226.2.0/24"
"redis" = "10.224.7.0/24"
"redis-cache" = "10.224.8.0/24"
"registry" = "10.224.10.0/24"
"runner" = "10.224.16.0/24"
"sidekiq" = "10.225.1.0/24"
"stor" = "10.224.2.0/23"
"web" = "10.224.1.0/24"
###############################
# These will eventually (tm) be
......
......@@ -641,6 +641,37 @@ module "fe-lb-altssh" {
vpc = "${module.network.self_link}"
}
##################################
#
# External HAProxy LoadBalancer Registry
#
##################################
module "fe-lb-registry" {
bootstrap_version = 6
chef_provision = "${var.chef_provision}"
chef_run_list = "\"role[${var.environment}-base-lb-registry]\""
create_backend_service = true
dns_zone_name = "${var.dns_zone_name}"
environment = "${var.environment}"
health_check = "http"
ip_cidr_range = "${var.subnetworks["fe-lb-registry"]}"
kernel_version = "${var.default_kernel_version}"
machine_type = "${var.machine_types["fe-lb"]}"
name = "fe-registry"
node_count = "${var.node_count["fe-lb-registry"]}"
project = "${var.project}"
public_ports = "${var.public_ports["fe-lb"]}"
region = "${var.region}"
service_account_email = "${var.service_account_email}"
service_path = "/-/available-https"
service_port = 8002
source = "../../modules/google/generic-sv-with-group"
tier = "lb"
use_new_node_name = true
vpc = "${module.network.self_link}"
}
##################################
#
# GCP TCP LoadBalancers
......@@ -726,6 +757,23 @@ module "gcp-tcp-lb-altssh" {
targets = ["fe-altssh"]
}
#### Load balancer for registry
module "gcp-tcp-lb-registry" {
environment = "${var.environment}"
forwarding_port_ranges = "${var.tcp_lbs_registry["forwarding_port_ranges"]}"
fqdns = "${var.lb_fqdns_registry}"
gitlab_zone_id = "${var.gitlab_com_zone_id}"
health_check_ports = "${var.tcp_lbs_registry["health_check_ports"]}"
instances = ["${module.fe-lb-registry.instances_self_link}"]
lb_count = "${length(var.tcp_lbs_registry["names"])}"
name = "gcp-tcp-lb-registry"
names = "${var.tcp_lbs_registry["names"]}"
project = "${var.project}"
region = "${var.region}"
source = "../../modules/google/tcp-lb"
targets = ["fe-registry"]
}
#### Load balancer for bastion
module "gcp-tcp-lb-bastion" {
environment = "${var.environment}"
......
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