10 lines
2.5 KiB
JSON
10 lines
2.5 KiB
JSON
{
|
|
"Format": "hcl2",
|
|
"JobID": "postgres-15",
|
|
"JobModifyIndex": 13569135,
|
|
"Namespace": "default",
|
|
"Source": "job \"postgres-15\" {\n type = \"system\"\n datacenters = [\"dc1\"]\n\n group \"group\" {\n count = 1\n\n network {\n \n port api { \n static = 8008 \n to = 8008 \n }\n port pg { \n static = 5432 \n to = 5432 \n }\n }\n\n task \"db\" {\n driver = \"docker\"\n\n template {\n data = <<EOL\nscope: postgres\nname: pg-{{env \"node.unique.name\"}}\nnamespace: /nomad\n\nrestapi:\n listen: 0.0.0.0:8008\n connect_address: {{env \"attr.unique.network.ip-address\"}}:8008\n\nconsul:\n scheme: http\n host: {{env \"attr.unique.network.ip-address\"}}:8500\n register_service: True\n\nbootstrap:\n dcs:\n ttl: 30\n loop_wait: 10\n retry_timeout: 10\n maximum_lag_on_failover: 1048576\n postgresql:\n use_pg_rewind: true\n use_slots: true\n parameters:\n timezone: 'UTC'\n max_connections: 100\n shared_preload_libraries: pg_stat_statements\n shared_buffers: 64MB\n work_mem: 16MB\n effective_cache_size: 512MB\n tcp_keepalives_idle: 300\n timescaledb.telemetry_level: off\n\n method: local\n local:\n command: /usr/local/bin/docker-initdb.sh\n keep_existing_recovery_conf: True\n\n initdb:\n - encoding: UTF8\n\n pg_hba:\n - host all postgres all md5\n - host replication repl all md5\n - host all all all md5\n\n users:\n postgres:\n password: postgres\n options:\n - createrole\n - createdb\n repl:\n password: repl\n options:\n - replication\n\npostgresql:\n listen: 0.0.0.0:5432\n connect_address: {{env \"attr.unique.network.ip-address\"}}:5432\n use_unix_socket: true\n data_dir: /store/data\n authentication:\n replication:\n username: repl\n password: repl\n superuser:\n username: postgres\n password: postgres\nEOL\n\n destination = \"/secrets/patroni.yml\"\n }\n\n config {\n image = \"ghcr.io/sstent/nomad-pgsql-patroni:latest\"\n volumes = [\n \"/mnt/configs/postgres:/store\",\n ]\n ports = [\"api\", \"pg\"]\n \n }\nenv {\n PGDATA=\"/store/data\"\n // POSTGRES_USER=\"root\"\n // POSTGRES_PASSWORD=\"rootpassword\"\n }\n resources {\n memory = 1024\n }\n }\n }\n}\n",
|
|
"VariableFlags": null,
|
|
"Variables": "",
|
|
"Version": 2
|
|
} |