run grafana inmemory
This commit is contained in:
@@ -83,6 +83,9 @@ in
|
|||||||
# TriOS
|
# TriOS
|
||||||
harfbuzz
|
harfbuzz
|
||||||
libepoxy
|
libepoxy
|
||||||
|
# android
|
||||||
|
libpng
|
||||||
|
libbsd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
let
|
let
|
||||||
useHttps = config.services.step-ca.enable;
|
useHttps = config.services.step-ca.enable;
|
||||||
fqdn = "grafana.home.arpa";
|
fqdn = "grafana.home.arpa";
|
||||||
base = "/mnt/250ssd";
|
base = "/mnt/tmpfs";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
age.secrets.grafana-contact-points = {
|
age.secrets.grafana-contact-points = {
|
||||||
@@ -16,17 +16,48 @@ in
|
|||||||
file = ../../secrets/grafana-contact-points.age;
|
file = ../../secrets/grafana-contact-points.age;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
age.secrets.grafana-pw = {
|
||||||
|
owner = "grafana";
|
||||||
|
file = ../../secrets/grafana-pw.age;
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"${base}" = {
|
||||||
|
device = "tmpfs";
|
||||||
|
fsType = "tmpfs";
|
||||||
|
options = [
|
||||||
|
"size=1G"
|
||||||
|
"mode=1777"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${base} 0755 grafana grafana -"
|
||||||
|
"d ${base}/grafana 0750 grafana grafana -"
|
||||||
|
"d ${base}/loki 0750 loki grafana -"
|
||||||
|
"d ${base}/prometheus 0750 prometheus grafana -"
|
||||||
|
#"d ${base}/prometheus/data 0750 prometheus grafana -"
|
||||||
|
"L+ /var/lib/prometheus2 - - - - ${base}/prometheus"
|
||||||
|
#"L+ /var/lib/${config.services.prometheus.stateDir}/data - - - - /${base}/prometheus/data"
|
||||||
|
];
|
||||||
|
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "${base}/grafana";
|
dataDir = "${base}/grafana";
|
||||||
settings.server = {
|
settings = {
|
||||||
domain = fqdn;
|
server = {
|
||||||
http_port = 2342;
|
domain = fqdn;
|
||||||
http_addr = "127.0.0.1";
|
http_port = 2342;
|
||||||
};
|
http_addr = "127.0.0.1";
|
||||||
settings.log = {
|
};
|
||||||
mode = "console";
|
log = {
|
||||||
level = "warn";
|
mode = "console";
|
||||||
|
level = "warn";
|
||||||
|
};
|
||||||
|
database = {
|
||||||
|
high_availability = false;
|
||||||
|
};
|
||||||
|
security.admin_password = "$__file{${config.age.secrets.grafana-pw.path}}";
|
||||||
};
|
};
|
||||||
|
|
||||||
provision.alerting.contactPoints.path = config.age.secrets.grafana-contact-points.path;
|
provision.alerting.contactPoints.path = config.age.secrets.grafana-contact-points.path;
|
||||||
@@ -57,8 +88,26 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.grafana = {
|
systemd.services = {
|
||||||
after = [ "step-ca.service" ];
|
loki = {
|
||||||
|
after = [
|
||||||
|
"mnt-tmpfs.mount"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
prometheus = {
|
||||||
|
after = [
|
||||||
|
"mnt-tmpfs.mount"
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
StateDirectory = lib.mkForce "${base}/prometheus";
|
||||||
|
WorkingDirectory = lib.mkForce "${base}/prometheus";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
grafana = {
|
||||||
|
after = [
|
||||||
|
"step-ca.service"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
security.acme.certs."${fqdn}".server = "https://127.0.0.1:8443/acme/kop-acme/directory";
|
security.acme.certs."${fqdn}".server = "https://127.0.0.1:8443/acme/kop-acme/directory";
|
||||||
|
|||||||
8961
modules/services/grafana/dashboards/cadvisor.json
Normal file
8961
modules/services/grafana/dashboards/cadvisor.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@ common:
|
|||||||
kvstore:
|
kvstore:
|
||||||
store: inmemory
|
store: inmemory
|
||||||
replication_factor: 1
|
replication_factor: 1
|
||||||
path_prefix: /mnt/250ssd/loki/common
|
path_prefix: /mnt/tmpfs/loki/common
|
||||||
|
|
||||||
schema_config:
|
schema_config:
|
||||||
configs:
|
configs:
|
||||||
|
|||||||
BIN
secrets/grafana-pw.age
Normal file
BIN
secrets/grafana-pw.age
Normal file
Binary file not shown.
@@ -92,6 +92,10 @@ in
|
|||||||
server-vm
|
server-vm
|
||||||
kop
|
kop
|
||||||
];
|
];
|
||||||
|
"grafana-pw.age".publicKeys = [
|
||||||
|
server-vm
|
||||||
|
kop
|
||||||
|
];
|
||||||
"fileshelter-conf.age".publicKeys = [
|
"fileshelter-conf.age".publicKeys = [
|
||||||
server-vm
|
server-vm
|
||||||
kop
|
kop
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
../../modules/services/duckdns.nix
|
../../modules/services/duckdns.nix
|
||||||
../../modules/services/samba.nix
|
../../modules/services/samba.nix
|
||||||
../../modules/services/ddclient-cloudflare.nix
|
../../modules/services/ddclient-cloudflare.nix
|
||||||
|
../../modules/services/grafana.nix
|
||||||
./disk-config.nix
|
./disk-config.nix
|
||||||
./mail.nix
|
./mail.nix
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
mainUser.layout = "de";
|
mainUser.layout = "de";
|
||||||
mainUser.variant = "us";
|
mainUser.variant = "us";
|
||||||
custom = {
|
custom = {
|
||||||
|
tmpfs.enable = true;
|
||||||
static-ip = {
|
static-ip = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ip = "192.168.0.10";
|
ip = "192.168.0.10";
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
code = {
|
code = {
|
||||||
enable = true;
|
enable = true;
|
||||||
android.enable = false;
|
android.enable = true;
|
||||||
};
|
};
|
||||||
#emulators.enable = true;
|
#emulators.enable = true;
|
||||||
games = {
|
games = {
|
||||||
|
|||||||
Reference in New Issue
Block a user