Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
gitlab-com-infrastructure
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
14
Merge Requests
14
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gitlab-com
gitlab-com-infrastructure
Commits
1184fc32
Commit
1184fc32
authored
Jun 28, 2018
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup altssh for gstg/gprd
Closes
https://gitlab.com/gitlab-com/migration/issues/590
parent
47ad9d7c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
39 deletions
+51
-39
environments/gprd/main.tf
environments/gprd/main.tf
+14
-13
environments/gprd/variables.tf
environments/gprd/variables.tf
+5
-4
environments/gstg/main.tf
environments/gstg/main.tf
+14
-13
environments/gstg/variables.tf
environments/gstg/variables.tf
+5
-4
modules/google/tcp-lb/loadbalancing.tf
modules/google/tcp-lb/loadbalancing.tf
+7
-5
modules/google/tcp-lb/variables.tf
modules/google/tcp-lb/variables.tf
+6
-0
No files found.
environments/gprd/main.tf
View file @
1184fc32
...
@@ -712,19 +712,20 @@ module "gcp-tcp-lb-pages" {
...
@@ -712,19 +712,20 @@ module "gcp-tcp-lb-pages" {
#### Load balancer for altssh
#### Load balancer for altssh
module
"gcp-tcp-lb-altssh"
{
module
"gcp-tcp-lb-altssh"
{
name
=
"gcp-tcp-lb-altssh"
name
=
"gcp-tcp-lb-altssh"
lb_count
=
"
${
length
(
var
.
tcp_lbs_altssh
[
"names"
])
}
"
lb_count
=
"
${
length
(
var
.
tcp_lbs_altssh
[
"names"
])
}
"
names
=
"
${
var
.
tcp_lbs_altssh
[
"names"
]
}
"
names
=
"
${
var
.
tcp_lbs_altssh
[
"names"
]
}
"
fqdn
=
"
${
var
.
lb_fqdn_altssh
}
"
fqdn
=
"
${
var
.
lb_fqdn_altssh
}
"
gitlab_zone_id
=
"
${
var
.
gitlab_com_zone_id
}
"
gitlab_zone_id
=
"
${
var
.
gitlab_com_zone_id
}
"
environment
=
"
${
var
.
environment
}
"
environment
=
"
${
var
.
environment
}
"
region
=
"
${
var
.
region
}
"
region
=
"
${
var
.
region
}
"
project
=
"
${
var
.
project
}
"
project
=
"
${
var
.
project
}
"
source
=
"../../modules/google/tcp-lb"
source
=
"../../modules/google/tcp-lb"
targets
=
[
"fe-altssh"
]
targets
=
[
"fe-altssh"
]
forwarding_port_ranges
=
"
${
var
.
tcp_lbs_altssh
[
"forwarding_port_ranges"
]
}
"
forwarding_port_ranges
=
"
${
var
.
tcp_lbs_altssh
[
"forwarding_port_ranges"
]
}
"
health_check_ports
=
"
${
var
.
tcp_lbs_altssh
[
"health_check_ports"
]
}
"
health_check_ports
=
"
${
var
.
tcp_lbs_altssh
[
"health_check_ports"
]
}
"
instances
=
[
"
${module
.
fe-lb-altssh
.
instances_self_link
}
"
]
health_check_request_paths
=
"
${
var
.
tcp_lbs_altssh
[
"health_check_request_paths"
]
}
"
instances
=
[
"
${module
.
fe-lb-altssh
.
instances_self_link
}
"
]
}
}
#### Load balancer for bastion
#### Load balancer for bastion
...
...
environments/gprd/variables.tf
View file @
1184fc32
...
@@ -23,7 +23,7 @@ variable "lb_fqdn" {
...
@@ -23,7 +23,7 @@ variable "lb_fqdn" {
##########
##########
variable
"lb_fqdn_altssh"
{
variable
"lb_fqdn_altssh"
{
default
=
"
lb-test-
altssh.gprd.gitlab.com"
default
=
"altssh.gprd.gitlab.com"
}
}
variable
"lb_fqdn_pages"
{
variable
"lb_fqdn_pages"
{
...
@@ -77,9 +77,10 @@ variable "tcp_lbs_altssh" {
...
@@ -77,9 +77,10 @@ variable "tcp_lbs_altssh" {
type
=
"map"
type
=
"map"
default
=
{
default
=
{
"names"
=
[
"ssh"
]
"names"
=
[
"https"
]
"forwarding_port_ranges"
=
[
"22"
]
"forwarding_port_ranges"
=
[
"443"
]
"health_check_ports"
=
[
"8003"
]
"health_check_ports"
=
[
"8003"
]
"health_check_request_paths"
=
[
"/-/available-ssh"
]
}
}
}
}
...
...
environments/gstg/main.tf
View file @
1184fc32
...
@@ -700,19 +700,20 @@ module "gcp-tcp-lb-pages" {
...
@@ -700,19 +700,20 @@ module "gcp-tcp-lb-pages" {
#### Load balancer for altssh
#### Load balancer for altssh
module
"gcp-tcp-lb-altssh"
{
module
"gcp-tcp-lb-altssh"
{
name
=
"gcp-tcp-lb-altssh"
name
=
"gcp-tcp-lb-altssh"
lb_count
=
"
${
length
(
var
.
tcp_lbs_altssh
[
"names"
])
}
"
lb_count
=
"
${
length
(
var
.
tcp_lbs_altssh
[
"names"
])
}
"
names
=
"
${
var
.
tcp_lbs_altssh
[
"names"
]
}
"
names
=
"
${
var
.
tcp_lbs_altssh
[
"names"
]
}
"
fqdn
=
"
${
var
.
lb_fqdn_altssh
}
"
fqdn
=
"
${
var
.
lb_fqdn_altssh
}
"
gitlab_zone_id
=
"
${
var
.
gitlab_com_zone_id
}
"
gitlab_zone_id
=
"
${
var
.
gitlab_com_zone_id
}
"
environment
=
"
${
var
.
environment
}
"
environment
=
"
${
var
.
environment
}
"
region
=
"
${
var
.
region
}
"
region
=
"
${
var
.
region
}
"
project
=
"
${
var
.
project
}
"
project
=
"
${
var
.
project
}
"
source
=
"../../modules/google/tcp-lb"
source
=
"../../modules/google/tcp-lb"
targets
=
[
"fe-altssh"
]
targets
=
[
"fe-altssh"
]
forwarding_port_ranges
=
"
${
var
.
tcp_lbs_altssh
[
"forwarding_port_ranges"
]
}
"
forwarding_port_ranges
=
"
${
var
.
tcp_lbs_altssh
[
"forwarding_port_ranges"
]
}
"
health_check_ports
=
"
${
var
.
tcp_lbs_altssh
[
"health_check_ports"
]
}
"
health_check_ports
=
"
${
var
.
tcp_lbs_altssh
[
"health_check_ports"
]
}
"
instances
=
[
"
${module
.
fe-lb-altssh
.
instances_self_link
}
"
]
health_check_request_paths
=
"
${
var
.
tcp_lbs_altssh
[
"health_check_request_paths"
]
}
"
instances
=
[
"
${module
.
fe-lb-altssh
.
instances_self_link
}
"
]
}
}
#### Load balancer for bastion
#### Load balancer for bastion
...
...
environments/gstg/variables.tf
View file @
1184fc32
...
@@ -66,7 +66,7 @@ variable "lb_fqdn" {
...
@@ -66,7 +66,7 @@ variable "lb_fqdn" {
#####
#####
variable
"lb_fqdn_altssh"
{
variable
"lb_fqdn_altssh"
{
default
=
"
lb-test-
altssh.gstg.gitlab.com"
default
=
"altssh.gstg.gitlab.com"
}
}
variable
"lb_fqdn_pages"
{
variable
"lb_fqdn_pages"
{
...
@@ -120,9 +120,10 @@ variable "tcp_lbs_altssh" {
...
@@ -120,9 +120,10 @@ variable "tcp_lbs_altssh" {
type
=
"map"
type
=
"map"
default
=
{
default
=
{
"names"
=
[
"ssh"
]
"names"
=
[
"https"
]
"forwarding_port_ranges"
=
[
"22"
]
"forwarding_port_ranges"
=
[
"443"
]
"health_check_ports"
=
[
"8003"
]
"health_check_ports"
=
[
"8003"
]
"health_check_request_paths"
=
[
"/-/available-ssh"
]
}
}
}
}
...
...
modules/google/tcp-lb/loadbalancing.tf
View file @
1184fc32
...
@@ -75,11 +75,13 @@ resource "google_compute_target_pool" "default" {
...
@@ -75,11 +75,13 @@ resource "google_compute_target_pool" "default" {
}
}
resource
"google_compute_http_health_check"
"default"
{
resource
"google_compute_http_health_check"
"default"
{
count
=
"
${
var
.
lb_count
}
"
count
=
"
${
var
.
lb_count
}
"
name
=
"
${
format
(
"%v-%v-%v"
,
var
.
environment
,
var
.
name
,
var
.
names
[
count
.
index
])
}
"
name
=
"
${
format
(
"%v-%v-%v"
,
var
.
environment
,
var
.
name
,
var
.
names
[
count
.
index
])
}
"
project
=
"
${
var
.
project
}
"
project
=
"
${
var
.
project
}
"
port
=
"
${
var
.
health_check_ports
[
count
.
index
]
}
"
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
timeout_sec = 2
check_interval_sec = 2
check_interval_sec = 2
healthy_threshold = 2
healthy_threshold = 2
...
...
modules/google/tcp-lb/variables.tf
View file @
1184fc32
...
@@ -28,6 +28,12 @@ variable "health_check_ports" {
...
@@ -28,6 +28,12 @@ variable "health_check_ports" {
type
=
"list"
type
=
"list"
}
}
variable
"health_check_request_paths"
{
type
=
"list"
default
=
[]
}
variable
"forwarding_port_ranges"
{
variable
"forwarding_port_ranges"
{
type
=
"list"
type
=
"list"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment