variables.tf 7.63 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
variable "region" {
  default = "us-east1"
}

variable "environment" {
  default = "pre"
}

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

variable "machine_types" {
  type = "map"

  default = {
John Jarvis's avatar
John Jarvis committed
34 35 36 37
    "bastion"            = "n1-standard-1"
    "gitlab-pre"         = "n1-standard-16"
    "monitoring"         = "n1-standard-2"
    "sd-exporter"        = "n1-standard-1"
38
    "gitlab-gke"         = "n1-standard-1"
John Jarvis's avatar
John Jarvis committed
39 40 41 42 43 44 45 46 47 48
    "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"
49
    "consul"             = "n1-standard-1"
John Jarvis's avatar
John Jarvis committed
50
    "proxy"              = "n1-standard-1"
51
    "thanos"             = "n1-standard-1"
John Jarvis's avatar
John Jarvis committed
52 53 54 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
  }
}

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"]
}

88 89 90 91 92 93 94 95 96
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
97 98 99 100 101 102 103 104 105
# 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
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
    "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"
124
    "gitlab-gke"     = "10.232.20.0/24"
125
    "web-puma"       = "10.232.21.0/24"
126
    "consul"         = "10.232.22.0/24"
John Jarvis's avatar
John Jarvis committed
127 128
    "pubsubbeat"     = "10.232.23.0/24"
    "proxy"          = "10.232.24.0/24"
129 130
    "thanos-compact" = "10.232.25.0/24"
    "thanos-store"   = "10.232.26.0/24"
John Jarvis's avatar
John Jarvis committed
131

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

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

138 139
    "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
140 141 142
  }
}

143 144 145 146 147 148 149 150
variable "master_cidr_subnets" {
  type = "map"

  default = {
    "gitlab-gke" = "172.16.0.0/28"
  }
}

John Jarvis's avatar
John Jarvis committed
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
##################
# 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
179
    "web"         = []
John Jarvis's avatar
John Jarvis committed
180
    "web-puma"    = [443, 80, 22]
John Jarvis's avatar
John Jarvis committed
181 182 183 184 185 186 187 188
    "api"         = []
    "git"         = []
    "sidekiq"     = []
    "registry"    = []
    "web-pages"   = []
    "fe-lb"       = [22, 80, 443]
    "gitaly"      = []
    "deploy"      = []
189
    "consul"      = []
John Jarvis's avatar
John Jarvis committed
190 191
    "pubsubbeat"  = []
    "proxy"       = []
192
    "thanos"      = []
John Jarvis's avatar
John Jarvis committed
193 194 195 196 197 198 199
  }
}

variable "node_count" {
  type = "map"

  default = {
John Jarvis's avatar
John Jarvis committed
200 201 202 203 204 205 206 207 208 209 210
    "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
211
    "fe-lb"              = 2
John Jarvis's avatar
John Jarvis committed
212 213 214 215
    "fe-lb-pages"        = 1
    "fe-lb-registry"     = 1
    "gitaly"             = 1
    "deploy"             = 1
216
    "consul"             = 1
217
    "thanos"             = 1
John Jarvis's avatar
John Jarvis committed
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
  }
}

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
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
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
256 257 258 259 260
variable "lb_fqdns_bastion" {
  type    = "list"
  default = ["lb-bastion.pre.gitlab.com"]
}

John Jarvis's avatar
John Jarvis committed
261 262 263 264 265 266 267 268 269 270
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
271 272 273 274 275 276 277 278 279 280
variable "tcp_lbs_bastion" {
  type = "map"

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

John Jarvis's avatar
John Jarvis committed
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
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
301 302 303 304 305 306 307 308 309 310 311
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
312 313 314 315 316 317 318 319 320 321
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
322 323 324 325 326 327 328 329
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
330 331 332 333 334 335 336 337 338 339

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

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