aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-12-25 12:16:18 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-12-25 12:16:18 +0100
commit48db0185a45e8682ab7dac53e836d6114c54b35e (patch)
tree3b52f1ce08583324d758a958cc6dcc0f8d122a22
parent4f23adfbb950f64ce6b94bc746b5cad5613c028e (diff)
downloadinfrastructure-48db0185a45e8682ab7dac53e836d6114c54b35e.tar.gz
infrastructure-48db0185a45e8682ab7dac53e836d6114c54b35e.zip
Migrate postgres
-rw-r--r--app/deployment/postgres.hcl35
1 files changed, 11 insertions, 24 deletions
diff --git a/app/deployment/postgres.hcl b/app/deployment/postgres.hcl
index d178491..388c65e 100644
--- a/app/deployment/postgres.hcl
+++ b/app/deployment/postgres.hcl
@@ -9,6 +9,11 @@ job "postgres" {
}
group "postgres" {
+ network {
+ port "psql_proxy_port" { static = 5432 }
+ port "psql_port" { static = 5433 }
+ }
+
task "sentinel" {
driver = "docker"
@@ -40,21 +45,14 @@ job "postgres" {
"--cluster-name", "pissenlit",
"--store-backend", "consul",
"--store-endpoints", "http://consul.service.2.cluster.deuxfleurs.fr:8500",
- "--port", "5432",
+ "--port", "${NOMAD_PORT_psql_proxy_port}",
"--listen-address", "0.0.0.0"
]
- port_map {
- psql_proxy_port = 5432
- }
+ ports = [ "psql_proxy_port" ]
}
resources {
memory = 100
- network {
- port "psql_proxy_port" {
- static = 5432
- }
- }
}
service {
@@ -93,34 +91,23 @@ job "postgres" {
"--pg-repl-username", "${PG_REPL_USER}",
"--pg-repl-password", "${PG_REPL_PWD}",
"--pg-listen-address", "${attr.unique.network.ip-address}",
- "--pg-port", "5433",
+ "--pg-port", "${NOMAD_PORT_psql_port}",
"--pg-bin-path", "/usr/lib/postgresql/9.6/bin/"
]
- port_map {
- psql_port = 5433
- }
+ ports = [ "psql_port" ]
volumes = [
"/mnt/ssd/postgres:/mnt/persist"
]
}
- artifact {
- source = "http://127.0.0.1:8500/v1/kv/configuration/postgres/keeper/env.tpl?raw"
- destination = "secrets/env.tpl"
- mode = "file"
- }
+
template {
- source = "secrets/env.tpl"
+ data = file("../config/configuration/postgres/keeper/env.tpl")
destination = "secrets/env"
env = true
}
resources {
memory = 500
- network {
- port "psql_port" {
- static = "5433"
- }
- }
}
service {