Commit 1184fc32 authored by Ahmad Sherif's avatar Ahmad Sherif

Setup altssh for gstg/gprd

Closes https://gitlab.com/gitlab-com/migration/issues/590
parent 47ad9d7c
......@@ -724,6 +724,7 @@ module "gcp-tcp-lb-altssh" {
targets = ["fe-altssh"]
forwarding_port_ranges = "${var.tcp_lbs_altssh["forwarding_port_ranges"]}"
health_check_ports = "${var.tcp_lbs_altssh["health_check_ports"]}"
health_check_request_paths = "${var.tcp_lbs_altssh["health_check_request_paths"]}"
instances = ["${module.fe-lb-altssh.instances_self_link}"]
}
......
......@@ -23,7 +23,7 @@ variable "lb_fqdn" {
##########
variable "lb_fqdn_altssh" {
default = "lb-test-altssh.gprd.gitlab.com"
default = "altssh.gprd.gitlab.com"
}
variable "lb_fqdn_pages" {
......@@ -77,9 +77,10 @@ variable "tcp_lbs_altssh" {
type = "map"
default = {
"names" = ["ssh"]
"forwarding_port_ranges" = ["22"]
"names" = ["https"]
"forwarding_port_ranges" = ["443"]
"health_check_ports" = ["8003"]
"health_check_request_paths" = ["/-/available-ssh"]
}
}
......
......@@ -712,6 +712,7 @@ module "gcp-tcp-lb-altssh" {
targets = ["fe-altssh"]
forwarding_port_ranges = "${var.tcp_lbs_altssh["forwarding_port_ranges"]}"
health_check_ports = "${var.tcp_lbs_altssh["health_check_ports"]}"
health_check_request_paths = "${var.tcp_lbs_altssh["health_check_request_paths"]}"
instances = ["${module.fe-lb-altssh.instances_self_link}"]
}
......
......@@ -66,7 +66,7 @@ variable "lb_fqdn" {
#####
variable "lb_fqdn_altssh" {
default = "lb-test-altssh.gstg.gitlab.com"
default = "altssh.gstg.gitlab.com"
}
variable "lb_fqdn_pages" {
......@@ -120,9 +120,10 @@ variable "tcp_lbs_altssh" {
type = "map"
default = {
"names" = ["ssh"]
"forwarding_port_ranges" = ["22"]
"names" = ["https"]
"forwarding_port_ranges" = ["443"]
"health_check_ports" = ["8003"]
"health_check_request_paths" = ["/-/available-ssh"]
}
}
......
......@@ -79,7 +79,9 @@ resource "google_compute_http_health_check" "default" {
name = "${format("%v-%v-%v", var.environment, var.name, var.names[count.index])}"
project = "${var.project}"
port = "${var.health_check_ports[count.index]}"
request_path = "/-/available-${var.names[count.index]}"
# Because request_paths can be empty, we use this element/concat hack, see https://stackoverflow.com/a/47415781/1856239
request_path = "${length(var.health_check_request_paths) > 0 ? element(concat(var.health_check_request_paths, list("")), count.index) : format("/-/available-%v", var.names[count.index])}"
timeout_sec = 2
check_interval_sec = 2
healthy_threshold = 2
......
......@@ -28,6 +28,12 @@ variable "health_check_ports" {
type = "list"
}
variable "health_check_request_paths" {
type = "list"
default = []
}
variable "forwarding_port_ranges" {
type = "list"
}
......
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