variables.tf 7.42 KB
Newer Older
John Jarvis's avatar
John Jarvis committed
1 2 3 4 5 6 7
## These variables must be set in env secrets!

variable "oauth2_client_id_log_proxy" {}
variable "oauth2_client_secret_log_proxy" {}
variable "oauth2_client_id_monitoring" {}
variable "oauth2_client_secret_monitoring" {}

John Jarvis's avatar
John Jarvis committed
8 9
variable "gitlab_io_zone_id" {}

John Jarvis's avatar
John Jarvis committed
10 11 12 13
variable "project" {
  default = "gitlab-pre"
}

John Jarvis's avatar
John Jarvis committed
14
variable "bootstrap_script_version" {
15
  default = 8
John Jarvis's avatar
John Jarvis committed
16 17
}

John Jarvis's avatar
John Jarvis committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
variable "region" {
  default = "us-east1"
}

variable "environment" {
  default = "pre"
}

variable "dns_zone_name" {
  default = "gitlab.net"
}

variable "default_kernel_version" {
  default = "4.15.0-1015"
}

variable "machine_types" {
  type = "map"

  default = {
John Jarvis's avatar
John Jarvis committed
38 39 40 41
    "bastion"            = "n1-standard-1"
    "gitlab-pre"         = "n1-standard-16"
    "monitoring"         = "n1-standard-2"
    "sd-exporter"        = "n1-standard-1"
42
    "gke-pre"            = "n1-standard-1"
John Jarvis's avatar
John Jarvis committed
43 44 45 46 47 48 49 50 51 52
    "gke-runner"         = "n1-standard-2"
    "web"                = "n1-standard-1"
    "git"                = "n1-standard-1"
    "api"                = "n1-standard-1"
    "sidekiq-besteffort" = "n1-standard-1"
    "registry"           = "n1-standard-1"
    "web-pages"          = "n1-standard-1"
    "fe-lb"              = "n1-standard-1"
    "gitaly"             = "n1-standard-1"
    "deploy"             = "n1-standard-1"
53
    "consul"             = "n1-standard-1"
John Jarvis's avatar
John Jarvis committed
54
    "proxy"              = "n1-standard-1"
John Jarvis's avatar
John Jarvis committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
  }
}

variable "monitoring_hosts" {
  type = "map"

  default = {
    "names" = ["prometheus", "prometheus-app"]
    "ports" = [9090, 9090]
  }
}

variable "service_account_email" {
  type = "string"

  default = "[email protected]"
}

#############################
# Default firewall
# rule for allowing
# all protocols on all
# ports
#
# 10.232.x.x: all of pre
# 10.250.7.x: ops runner
# 10.250.10.x: chatops runner
# 10.250.12.x: release runner
# 10.12.0.0/14: pod address range in gitlab-ops for runners
###########################

variable "internal_subnets" {
  type    = "list"
  default = ["10.232.0.0/13", "10.250.7.0/24", "10.250.10.0/24", "10.250.12.0/24", "10.12.0.0/14"]
}

91 92 93 94 95 96 97 98 99
variable "other_monitoring_subnets" {
  type = "list"

  # 10.219.1.0/24: gprd
  # 10.251.17.0/24: dr
  # Left empty for preprod
  default = []
}

John Jarvis's avatar
John Jarvis committed
100 101 102 103 104 105 106 107 108
# The pre network is allocated
# 10.232.0.0/13
#   First IP: 10.232.0.0
#   Last IP:  10.239.255.255

variable "subnetworks" {
  type = "map"

  default = {
John Jarvis's avatar
John Jarvis committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
    "bastion"        = "10.232.1.0/24"
    "gitlab-pre"     = "10.232.2.0/24"
    "monitoring"     = "10.232.3.0/24"
    "pubsubbeat"     = "10.232.4.0/24"
    "gke-runner"     = "10.232.5.0/24"
    "sd-exporter"    = "10.232.6.0/24"
    "redis      "    = "10.232.7.0/24"
    "fe-lb"          = "10.232.9.0/24"
    "fe-lb-pages"    = "10.232.10.0/24"
    "fe-lb-registry" = "10.232.11.0/24"
    "registry"       = "10.232.12.0/24"
    "web"            = "10.232.13.0/24"
    "api"            = "10.232.14.0/24"
    "git"            = "10.232.15.0/24"
    "sidekiq"        = "10.232.16.0/24"
    "web-pages"      = "10.232.17.0/24"
    "gitaly"         = "10.232.18.0/24"
    "deploy"         = "10.232.19.0/24"
127 128
    "gke-pre"        = "10.232.20.0/24"
    "web-puma"       = "10.232.21.0/24"
129
    "consul"         = "10.232.22.0/24"
John Jarvis's avatar
John Jarvis committed
130 131
    "pubsubbeat"     = "10.232.23.0/24"
    "proxy"          = "10.232.24.0/24"
John Jarvis's avatar
John Jarvis committed
132

John Jarvis's avatar
John Jarvis committed
133 134 135
    "gke-pre-pod-cidr"     = "10.235.0.0/16"
    "gke-pre-service-cidr" = "10.236.0.0/16"

John Jarvis's avatar
John Jarvis committed
136 137 138
    # /mnt/storage
    "filestore-storage" = "10.237.0.0/29"

139 140
    "gke-runner-pod-cidr"     = "10.238.0.0/16"
    "gke-runner-service-cidr" = "10.239.0.0/16"
John Jarvis's avatar
John Jarvis committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
  }
}

##################
# Network Peering
##################

variable "network_env" {
  default = "https://www.googleapis.com/compute/v1/projects/gitlab-pre/global/networks/pre"
}

variable "peer_networks" {
  type = "map"

  default = {
    "names" = ["ops"]

    "links" = [
      "https://www.googleapis.com/compute/v1/projects/gitlab-ops/global/networks/ops",
    ]
  }
}

variable "public_ports" {
  type = "map"

  default = {
    "bastion"     = [22]
    "gitlab-pre"  = [443, 80, 22, 5005]
    "sd-exporter" = []
    "pubsubbeat"  = []
John Jarvis's avatar
John Jarvis committed
172
    "web"         = []
John Jarvis's avatar
John Jarvis committed
173
    "web-puma"    = [443, 80, 22]
John Jarvis's avatar
John Jarvis committed
174 175 176 177 178 179 180 181
    "api"         = []
    "git"         = []
    "sidekiq"     = []
    "registry"    = []
    "web-pages"   = []
    "fe-lb"       = [22, 80, 443]
    "gitaly"      = []
    "deploy"      = []
182
    "consul"      = []
John Jarvis's avatar
John Jarvis committed
183 184
    "pubsubbeat"  = []
    "proxy"       = []
John Jarvis's avatar
John Jarvis committed
185 186 187 188 189 190 191
  }
}

variable "node_count" {
  type = "map"

  default = {
John Jarvis's avatar
John Jarvis committed
192 193 194 195 196 197 198 199 200 201 202
    "bastion"            = 1
    "gitlab-pre"         = 1
    "prometheus"         = 1
    "prometheus-app"     = 1
    "sd-exporter"        = 1
    "web"                = 1
    "git"                = 1
    "api"                = 1
    "sidekiq-besteffort" = 1
    "web-pages"          = 1
    "registry"           = 1
203
    "fe-lb"              = 2
John Jarvis's avatar
John Jarvis committed
204 205 206 207
    "fe-lb-pages"        = 1
    "fe-lb-registry"     = 1
    "gitaly"             = 1
    "deploy"             = 1
208
    "consul"             = 1
John Jarvis's avatar
John Jarvis committed
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
  }
}

variable "chef_provision" {
  type        = "map"
  description = "Configuration details for chef server"

  default = {
    bootstrap_bucket  = "gitlab-pre-chef-bootstrap"
    bootstrap_key     = "gitlab-pre-bootstrap-validation"
    bootstrap_keyring = "gitlab-pre-bootstrap"

    server_url    = "https://chef.gitlab.com/organizations/gitlab/"
    user_name     = "gitlab-ci"
    user_key_path = ".chef.pem"
    version       = "12.22.5"
  }
}

variable "monitoring_cert_link" {
  default = "projects/gitlab-pre/global/sslCertificates/wildcard-pre-gitlab-net"
}

John Jarvis's avatar
John Jarvis committed
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
variable "data_disk_sizes" {
  type = "map"

  default = {
    "file"  = "100"
    "share" = "100"
    "pages" = "100"
  }
}

variable "lb_fqdns" {
  type    = "list"
  default = ["test.pre.gitlab.com", "pre.gitlab.com"]
}

John Jarvis's avatar
John Jarvis committed
247 248 249 250 251
variable "lb_fqdns_bastion" {
  type    = "list"
  default = ["lb-bastion.pre.gitlab.com"]
}

John Jarvis's avatar
John Jarvis committed
252 253 254 255 256 257 258 259 260 261
variable "lb_fqdns_pages" {
  type    = "list"
  default = ["*.pages.pre.gitlab.io"]
}

variable "lb_fqdns_registry" {
  type    = "list"
  default = ["registry-test.pre.gitlab.com", "registry.pre.gitlab.com"]
}

John Jarvis's avatar
John Jarvis committed
262 263 264 265 266 267 268 269 270 271
variable "tcp_lbs_bastion" {
  type = "map"

  default = {
    "names"                  = ["ssh"]
    "forwarding_port_ranges" = ["22"]
    "health_check_ports"     = ["80"]
  }
}

John Jarvis's avatar
John Jarvis committed
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
variable "tcp_lbs_pages" {
  type = "map"

  default = {
    "names"                  = ["http", "https"]
    "forwarding_port_ranges" = ["80", "443"]
    "health_check_ports"     = ["8001", "8002"]
  }
}

variable "tcp_lbs_registry" {
  type = "map"

  default = {
    "names"                  = ["http", "https"]
    "forwarding_port_ranges" = ["80", "443"]
    "health_check_ports"     = ["8001", "8002"]
  }
}

John Jarvis's avatar
John Jarvis committed
292 293 294 295 296 297 298 299 300 301 302
variable "tcp_lbs_sentry" {
  type = "map"

  default = {
    "names"                      = ["http", "https"]
    "forwarding_port_ranges"     = ["80", "443"]
    "health_check_ports"         = ["9000", "9000"]
    "health_check_request_paths" = ["/auth/login/gitlab/", "/auth/login/gitlab/"]
  }
}

John Jarvis's avatar
John Jarvis committed
303 304 305 306 307 308 309 310 311 312
variable "tcp_lbs" {
  type = "map"

  default = {
    "names"                  = ["http", "https", "ssh"]
    "forwarding_port_ranges" = ["80", "443", "22"]
    "health_check_ports"     = ["8001", "8002", "8003"]
  }
}

John Jarvis's avatar
John Jarvis committed
313 314 315 316 317 318 319 320
variable "pre_gitlab_net_cert_link" {
  default = "projects/gitlab-pre/global/sslCertificates/pre-gitlab-net"
}

variable "gcs_service_account_email" {
  type    = "string"
  default = "[email protected]"
}
John Jarvis's avatar
John Jarvis committed
321 322 323 324 325 326 327 328 329 330

variable "egress_ports" {
  type    = "list"
  default = ["80", "443"]
}

variable "deploy_egress_ports" {
  type    = "list"
  default = ["80", "443", "22"]
}