depot/cluster/services/patroni/default.nix

47 lines
1 KiB
Nix
Raw Permalink Normal View History

{ config, ... }:
2022-08-05 00:57:54 +03:00
{
imports = [
./options.nix
./incandescence.nix
./simulacrum/test-data.nix
];
links = {
2022-08-05 00:57:54 +03:00
patroni-pg-internal.ipv4 = "0.0.0.0";
patroni-api.ipv4 = "0.0.0.0";
patroni-pg-access.ipv4 = "127.0.0.1";
};
services.patroni = {
nodes = {
worker = [ "grail" "thunderskin" "VEGAS" ];
haproxy = [ "checkmate" "grail" "VEGAS" "prophet" ];
2022-08-05 00:57:54 +03:00
};
nixos = {
worker = [
./worker.nix
./metrics.nix
./create-databases.nix
];
2022-08-05 00:57:54 +03:00
haproxy = ./haproxy.nix;
};
secrets = let
inherit (config.services.patroni) nodes;
default = {
nodes = nodes.worker;
owner = "patroni";
};
in {
PATRONI_REPLICATION_PASSWORD = default;
PATRONI_SUPERUSER_PASSWORD = default;
PATRONI_REWIND_PASSWORD = default;
metricsCredentials.nodes = nodes.worker;
};
simulacrum = {
enable = true;
deps = [ "consul" "incandescence" "locksmith" ];
settings = ./simulacrum/test.nix;
};
2022-08-05 00:57:54 +03:00
};
}