mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
prometheus
This commit is contained in:
parent
0d39279ac9
commit
ec7be408a1
5 changed files with 58 additions and 3 deletions
|
|
@ -21,7 +21,9 @@
|
||||||
};
|
};
|
||||||
dns2 = {
|
dns2 = {
|
||||||
publicIPv4 = "128.140.3.7";
|
publicIPv4 = "128.140.3.7";
|
||||||
publicIPv6 = "2a01:4f8:c2c:d616::";
|
# somehow this doesnt quite work yet, keep it out of DNS records
|
||||||
|
#publicIPv6 = "2a01:4f8:c2c:d616::";
|
||||||
|
publicIPv6 = null;
|
||||||
};
|
};
|
||||||
vps1 = {
|
vps1 = {
|
||||||
publicIPv4 = "161.97.165.1";
|
publicIPv4 = "161.97.165.1";
|
||||||
|
|
@ -43,7 +45,9 @@
|
||||||
};
|
};
|
||||||
vps4 = {
|
vps4 = {
|
||||||
publicIPv4 = "195.201.147.17";
|
publicIPv4 = "195.201.147.17";
|
||||||
publicIPv6 = "2a01:4f8:1c1c:cb18::";
|
# somehow this doesnt quite work yet, keep it out of DNS records
|
||||||
|
#publicIPv6 = "2a01:4f8:1c1c:cb18::1";
|
||||||
|
publicIPv6 = null;
|
||||||
wg = {
|
wg = {
|
||||||
privateIP = "10.0.0.4";
|
privateIP = "10.0.0.4";
|
||||||
publicKey = "+n2XKKaSFdCanEGRd41cvnuwJ0URY0HsnpBl6ZrSBRs=";
|
publicKey = "+n2XKKaSFdCanEGRd41cvnuwJ0URY0HsnpBl6ZrSBRs=";
|
||||||
|
|
@ -163,6 +167,7 @@
|
||||||
./modules/wg-mesh
|
./modules/wg-mesh
|
||||||
./modules/ingress
|
./modules/ingress
|
||||||
./modules/garage
|
./modules/garage
|
||||||
|
./modules/prometheus
|
||||||
];
|
];
|
||||||
|
|
||||||
deployment.tags = [ "eu" "apps" "wg" ];
|
deployment.tags = [ "eu" "apps" "wg" ];
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,13 @@
|
||||||
boot.tmp.cleanOnBoot = true;
|
boot.tmp.cleanOnBoot = true;
|
||||||
zramSwap.enable = true;
|
zramSwap.enable = true;
|
||||||
|
|
||||||
|
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 9100 ];
|
||||||
|
services.prometheus.exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,17 @@
|
||||||
|
|
||||||
insecure true
|
insecure true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
servers {
|
||||||
|
metrics
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
http:// {
|
http:// {
|
||||||
respond "This is an HTTPS-only server, silly you. Go to https:// instead." 418
|
respond "This is an HTTPS-only server, silly you. Go to https:// instead." 418
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# HTTP
|
||||||
|
:9010 {
|
||||||
|
metrics /metrics
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ caddy ];
|
environment.systemPackages = [ caddy ];
|
||||||
|
|
||||||
|
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 9010 ]; # metrics
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
80 # HTTP
|
80 # HTTP
|
||||||
|
|
@ -54,7 +56,7 @@ in
|
||||||
if name == "vps1" || name == "vps3" || name == "vps4" then ''
|
if name == "vps1" || name == "vps3" || name == "vps4" then ''
|
||||||
noratrieb.dev {
|
noratrieb.dev {
|
||||||
encode zstd gzip
|
encode zstd gzip
|
||||||
header -Last-Modified
|
header -Last-Modified2a01:4f8:1c1c:cb18::
|
||||||
root * ${import ./caddy-static-prepare {
|
root * ${import ./caddy-static-prepare {
|
||||||
name = "website";
|
name = "website";
|
||||||
src = website { inherit pkgs slides blog; };
|
src = website { inherit pkgs slides blog; };
|
||||||
|
|
|
||||||
32
newinfra/nix/modules/prometheus/default.nix
Normal file
32
newinfra/nix/modules/prometheus/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ ... }: {
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
globalConfig = { };
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "prometheus";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "localhost:9090" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "vps1.local:9100" ]; }
|
||||||
|
{ targets = [ "vps3.local:9100" ]; }
|
||||||
|
{ targets = [ "vps4.local:9100" ]; }
|
||||||
|
{ targets = [ "vps5.local:9100" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
job_name = "caddy";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "vps1.local:9010" ]; }
|
||||||
|
{ targets = [ "vps3.local:9010" ]; }
|
||||||
|
{ targets = [ "vps4.local:9010" ]; }
|
||||||
|
{ targets = [ "vps5.local:9010" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue