mirror of
https://github.com/Blockstream/satellite-api.git
synced 2025-03-11 01:27:15 +01:00
use host list and split in module; add dns module to misc workspace
This commit is contained in:
parent
d5e5aa9ec3
commit
ce5b8a6dae
10 changed files with 58 additions and 12 deletions
|
@ -89,6 +89,7 @@ plan_misc:
|
|||
-var "onion_host=$ONION_HOST"
|
||||
-var "prom_allowed_source_ip=$PROMETHEUS_ALLOWED_SOURCE_IP"
|
||||
-var "prom_service_acct=$PROM_SA"
|
||||
-var "opsgenie_key=$OPSGENIE_KEY"
|
||||
-var "satellite_lb=$SATELLITE_LB"
|
||||
-var "satellite_api_lb=$SATELLITE_API_LB"
|
||||
-var "satellite_api_lb_staging=$SATELLITE_API_LB_STAGING"
|
||||
|
@ -160,6 +161,7 @@ deploy_misc:
|
|||
-var "onion_host=$ONION_HOST"
|
||||
-var "prom_allowed_source_ip=$PROMETHEUS_ALLOWED_SOURCE_IP"
|
||||
-var "prom_service_acct=$PROM_SA"
|
||||
-var "opsgenie_key=$OPSGENIE_KEY"
|
||||
-var "satellite_lb=$SATELLITE_LB"
|
||||
-var "satellite_api_lb=$SATELLITE_API_LB"
|
||||
-var "satellite_api_lb_staging=$SATELLITE_API_LB_STAGING"
|
||||
|
|
|
@ -38,6 +38,7 @@ module "blc" {
|
|||
zone = "${var.zone}"
|
||||
instance_type = "${var.instance_type[0]}"
|
||||
host = ["${var.host}"]
|
||||
space_host = "${var.space_host}"
|
||||
ssl_cert = ["${var.ssl_cert}"]
|
||||
timeout = "${var.timeout}"
|
||||
prom_service_acct = "${var.prom_service_acct}"
|
||||
|
@ -62,7 +63,7 @@ module "tor" {
|
|||
|
||||
create_resources = "${local.create_misc}"
|
||||
|
||||
#CI vars
|
||||
# CI vars
|
||||
region = "${var.region}"
|
||||
zone = "${var.zone}"
|
||||
instance_type = "${var.instance_type[1]}"
|
||||
|
@ -81,7 +82,7 @@ module "prometheus" {
|
|||
|
||||
create_resources = "${local.create_misc}"
|
||||
|
||||
#CI vars
|
||||
# CI vars
|
||||
region = "${var.region}"
|
||||
zone = "${var.zone}"
|
||||
instance_type = "${var.instance_type[2]}"
|
||||
|
@ -89,3 +90,16 @@ module "prometheus" {
|
|||
opsgenie_key = "${var.opsgenie_key}"
|
||||
prom_service_acct = "${var.prom_service_acct}"
|
||||
}
|
||||
|
||||
module "dns" {
|
||||
source = "modules/dns"
|
||||
|
||||
project = "${var.project}"
|
||||
|
||||
create_resources = "${local.create_misc}"
|
||||
|
||||
# CI vars
|
||||
satellite_lb = "${var.satellite_lb}"
|
||||
satellite_api_lb = "${var.satellite_api_lb}"
|
||||
satellite_api_lb_staging = "${var.satellite_api_lb_staging}"
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ write_files:
|
|||
access_log /var/log/nginx/access.log withtime;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
server_name ${host};
|
||||
server_name ${host} ${space_host};
|
||||
listen 80 default_server;
|
||||
server_tokens off;
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ data "template_file" "blc" {
|
|||
ionosphere_sse_docker = "${var.ionosphere_sse_docker}"
|
||||
node_exporter_docker = "${var.node_exporter_docker}"
|
||||
opsgenie_key = "${var.opsgenie_key}"
|
||||
host = ["${var.host}"]
|
||||
host = "${var.host[0]}"
|
||||
space_host = "${var.host[1]}"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,10 @@ variable "host" {
|
|||
type = "list"
|
||||
}
|
||||
|
||||
variable "space_host" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "timeout" {
|
||||
type = "string"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ resource "google_dns_managed_zone" "blockstream-space" {
|
|||
dns_name = "blockstream.space."
|
||||
description = "A long time ago, in a galaxy far, far away... P.S. Don't edit directly in Gcloud, but rather in the Satellite API repo (Otherwise, things break and Chase gets really mad)."
|
||||
project = "${var.project}"
|
||||
count = "${var.create_resources}"
|
||||
|
||||
labels = {
|
||||
managed-by = "terraform"
|
||||
|
@ -14,6 +15,7 @@ resource "google_dns_record_set" "a-satellite" {
|
|||
managed_zone = "${google_dns_managed_zone.blockstream-space.name}"
|
||||
type = "A"
|
||||
ttl = 300
|
||||
count = "${var.create_resources}"
|
||||
|
||||
rrdatas = ["${var.satellite_lb}"]
|
||||
}
|
||||
|
@ -23,6 +25,7 @@ resource "google_dns_record_set" "a-satellite-api" {
|
|||
managed_zone = "${google_dns_managed_zone.blockstream-space.name}"
|
||||
type = "A"
|
||||
ttl = 300
|
||||
count = "${var.create_resources}"
|
||||
|
||||
rrdatas = ["${var.satellite_api_lb}"]
|
||||
}
|
||||
|
@ -32,6 +35,7 @@ resource "google_dns_record_set" "a-satellite-api-staging" {
|
|||
managed_zone = "${google_dns_managed_zone.blockstream-space.name}"
|
||||
type = "A"
|
||||
ttl = 300
|
||||
count = "${var.create_resources}"
|
||||
|
||||
rrdatas = ["${var.satellite_api_lb_staging}"]
|
||||
}
|
19
terraform/modules/dns/variables.tf
Normal file
19
terraform/modules/dns/variables.tf
Normal file
|
@ -0,0 +1,19 @@
|
|||
variable "project" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "satellite_lb" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "satellite_api_lb" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "satellite_api_lb_staging" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "create_resources" {
|
||||
type = "string"
|
||||
}
|
|
@ -2,7 +2,7 @@ bootcmd:
|
|||
- blkid /dev/disk/by-id/google-data || mkfs.ext4 -L data -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/disk/by-id/google-data
|
||||
|
||||
mounts:
|
||||
- [ /dev/disk/by-label/google-data, /mnt/disks/data, auto, defaults ]
|
||||
- [ /dev/disk/by-label/data, /mnt/disks/data, auto, defaults ]
|
||||
|
||||
users:
|
||||
- name: bs
|
||||
|
@ -18,9 +18,6 @@ write_files:
|
|||
# If an alert isn't caught by a route, send it to the pager.
|
||||
receiver: noc-pager
|
||||
routes:
|
||||
- match:
|
||||
severity: warning
|
||||
receiver: noc-email
|
||||
- match:
|
||||
severity: page
|
||||
receiver: noc-pager
|
||||
|
|
|
@ -67,4 +67,4 @@ variable "node_exporter_docker" {
|
|||
|
||||
variable "gcloud_docker" {
|
||||
type = "string"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,11 @@ variable "host" {
|
|||
default = ["", ""]
|
||||
}
|
||||
|
||||
variable "space_host" {
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "onion_host" {
|
||||
type = "string"
|
||||
default = ""
|
||||
|
@ -111,17 +116,17 @@ variable "opsgenie_key" {
|
|||
}
|
||||
|
||||
variable "satellite_lb" {
|
||||
type = "string"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "satellite_api_lb" {
|
||||
type = "string"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "satellite_api_lb_staging" {
|
||||
type = "string"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue