nixos

NixOS server files. Mirror from https://git.nordgedanken.dev/kubernetes/nixos
git clone git://archive.git.mtrnord.blog/MTRNord/nixos.git
Log | Files | Refs | README

commit 60e3ab89b10d59803ee710460863da0164228da6
parent db64b34936b42c24e89dd841c82fa74593d9c94b
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue,  5 Sep 2023 16:45:39 +0200

Add missing listeners and remove haproxy

Diffstat:
Mnixos/common/lib/envoy.nix | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mnixos/worker-1/configuration.nix | 30------------------------------
2 files changed, 60 insertions(+), 30 deletions(-)

diff --git a/nixos/common/lib/envoy.nix b/nixos/common/lib/envoy.nix @@ -46,6 +46,66 @@ } ]; } + { + name = "postgres_100.64.0.1"; + address = { + socket_address = { + address = "100.64.0.1"; + port_value = 5000; + }; + }; + filter_chains = [ + { + filters = [ + # { + # name = "envoy.filters.network.postgres_proxy"; + # typed_config = { + # "@type" = "type.googleapis.com/envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy"; + # stat_prefix = "destination"; + # }; + # } + { + name = "envoy.filters.network.tcp_proxy"; + typed_config = { + "@type" = "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy"; + stat_prefix = "destination"; + cluster = "postgres_cluster"; + }; + } + ]; + } + ]; + } + { + name = "postgres_127.0.0.1"; + address = { + socket_address = { + address = "127.0.0.1"; + port_value = 5000; + }; + }; + filter_chains = [ + { + filters = [ + # { + # name = "envoy.filters.network.postgres_proxy"; + # typed_config = { + # "@type" = "type.googleapis.com/envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy"; + # stat_prefix = "destination"; + # }; + # } + { + name = "envoy.filters.network.tcp_proxy"; + typed_config = { + "@type" = "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy"; + stat_prefix = "destination"; + cluster = "postgres_cluster"; + }; + } + ]; + } + ]; + } ]; clusters = [ { diff --git a/nixos/worker-1/configuration.nix b/nixos/worker-1/configuration.nix @@ -364,36 +364,6 @@ # ''; }; - haproxy = { - enable = false; - config = '' - global - maxconn 300 - nbthread 6 - cpu-map 1/all 0-5 - - defaults - log global - mode tcp - retries 2 - timeout client 30m - timeout connect 4s - timeout server 1m - timeout check 5s - - listen postgres - bind 100.64.0.1:5000 - bind 127.0.0.1:5000 - bind 10.100.12.1:5000 - mode tcp - option httpchk - http-check expect status 200 - default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions - server pg_new1 10.100.0.2:5432 maxconn 300 check port 8008 - server pg_new2 10.100.0.1:5432 maxconn 300 check port 8008 - ''; - }; - discourse = { enable = true; database = {