Commit 046efc0f authored by Yun Guo's avatar Yun Guo

Merge branch 'gstg-pg-11' into 'master'

patroni cluster for pg11

See merge request !807
parents 8263ca92 5cd46d01
......@@ -84,6 +84,11 @@ variable "lb_fqdns_internal_patroni" {
default = ["patroni.int.dr.gitlab.net"]
}
variable "lb_fqdns_internal_postgres_11" {
type = "list"
default = ["postgres11.int.dr.gitlab.net"]
}
#
# For every name there must be a corresponding
# forwarding port range and health check port
......@@ -310,6 +315,7 @@ variable "node_count" {
"git" = 1
"pages" = 1
"patroni" = 3
"postgres-11" = 0
"redis" = 3
"sd-exporter" = 1
"sidekiq-asap" = 0
......@@ -340,6 +346,7 @@ variable "subnetworks" {
"fe-lb-altssh" = "10.251.3.0/24"
"bastion" = "10.251.4.0/24"
"patroni" = "10.251.9.0/24"
"postgres11" = "10.251.10.0/24"
"deploy" = "10.251.14.0/24"
"console" = "10.251.16.0/24"
"consul" = "10.251.13.0/24"
......
......@@ -98,6 +98,11 @@ variable "lb_fqdns_internal_patroni" {
default = ["patroni.int.gprd.gitlab.net"]
}
variable "lb_fqdns_internal_postgres_11" {
type = "list"
default = ["postgres11.int.gprd.gitlab.net"]
}
variable "lb_fqdns_contributors" {
type = "list"
default = ["lb-contributors.gprd.gitlab.com"]
......@@ -387,6 +392,7 @@ variable "node_count" {
"git" = 25
"mailroom" = 2
"patroni" = 6
"postgres-11" = 0
"pages" = 1
"pgb" = 3
"redis" = 3
......@@ -439,6 +445,7 @@ variable "subnetworks" {
"db-dr-delayed" = "10.217.3.0/24"
"db-dr-archive" = "10.217.7.0/24"
"patroni" = "10.220.16.0/24"
"postgres11" = "10.220.19.0/24"
"pgb" = "10.217.4.0/24"
"redis-cache" = "10.217.5.0/24"
"consul" = "10.218.1.0/24"
......
......@@ -133,6 +133,11 @@ variable "lb_fqdns_internal_patroni" {
default = ["patroni.int.gstg.gitlab.net"]
}
variable "lb_fqdns_internal_postgres_11" {
type = "list"
default = ["postgres11.int.gstg.gitlab.net"]
}
variable "lb_fqdns_contributors" {
type = "list"
default = ["lb-contributors.gstg.gitlab.com"]
......@@ -383,6 +388,7 @@ variable "node_count" {
"mailroom" = 1
"pages" = 1
"patroni" = 6
"postgres-11" = 6
"pgb" = 3
"redis" = 3
"redis-cache" = 3
......@@ -440,6 +446,7 @@ variable "subnetworks" {
"mailroom" = "10.224.11.0/24"
"monitoring" = "10.226.1.0/24"
"patroni" = "10.224.29.0/24"
"postgres11" = "10.224.30.0/24"
"pgb" = "10.224.9.0/24"
"pubsubbeat" = "10.226.2.0/24"
"redis" = "10.224.7.0/24"
......
......@@ -557,6 +557,62 @@ module "patroni" {
os_disk_size = 100
}
###########################################################
#
# GCP Internal TCP LoadBalancer and Patroni for PG11
#
###########################################################
module "gcp-tcp-lb-internal-postgres-11" {
backend_service = "${module.patroni-pg-11.google_compute_region_backend_service_self_link}"
environment = "${var.environment}"
external = false
forwarding_port_ranges = ["6432"]
fqdns = "${var.lb_fqdns_internal_postgres_11}"
gitlab_zone_id = "${var.gitlab_net_zone_id}"
health_check_ports = ["8009"]
instances = ["${module.patroni-pg-11.instances_self_link}"]
lb_count = "${var.node_count["postgres-11"] > 0 ? 1 : 0}"
name = "gcp-tcp-lb-internal-postgres-11"
names = ["${var.environment}-postgres-11"]
project = "${var.project}"
region = "${var.region}"
source = "git::ssh://git@ops.gitlab.net/gitlab-com/gl-infra/terraform-modules/google/tcp-lb.git?ref=v1.0.0"
subnetwork_self_link = "${module.patroni-pg-11.google_compute_subnetwork_self_link}"
targets = ["postgres-11"]
vpc = "${module.network.self_link}"
}
module "patroni-pg-11" {
backend_service_type = "regional"
bootstrap_version = "${var.bootstrap_script_version}"
chef_provision = "${var.chef_provision}"
chef_run_list = "\"role[${var.environment}-base-db-postgres-11]\""
create_backend_service = true
data_disk_size = "${var.data_disk_sizes["patroni"]}"
data_disk_type = "pd-ssd"
dns_zone_name = "${var.dns_zone_name}"
environment = "${var.environment}"
health_check = "http"
health_check_port = "8009"
ip_cidr_range = "${var.subnetworks["postgres11"]}"
kernel_version = "${var.default_kernel_version}"
machine_type = "${var.machine_types["patroni"]}"
name = "postgres11"
node_count = "${var.node_count["postgres-11"]}"
project = "${var.project}"
public_ports = "${var.public_ports["patroni"]}"
region = "${var.region}"
service_account_email = "${var.service_account_email}"
service_path = "/"
service_port = 6432
source = "git::ssh://git@ops.gitlab.net/gitlab-com/gl-infra/terraform-modules/google/generic-stor-with-group.git?ref=v1.0.4"
tier = "db"
use_new_node_name = true
vpc = "${module.network.self_link}"
os_disk_size = 100
}
##################################
#
# Redis
......
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