1
0
Fork 0

Deploy vrchat-prometheus-adapter to cluster
Lint / lint (push) Successful in 21s Details

This commit is contained in:
Gabriel Simmer 2023-11-10 14:45:02 +00:00
parent d21c8fac35
commit be3c76801e
Signed by: arch
SSH Key Fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ
2 changed files with 58 additions and 1 deletions

View File

@ -1,5 +1,6 @@
{ lib, config, kubenix, ... }: {
imports = [ kubenix.modules.k8s
(import ./custom.nix)
(import ./tclip.nix) ];
(import ./tclip.nix)
(import ./vrchat-prometheus-exporter.nix) ];
}

View File

@ -0,0 +1,56 @@
let
appName = "vrchat-prometheus-exporter";
appImage = "git.gmem.ca/arch/vrchat-prometheus-adapter:arm";
in
{
kubernetes.resources."monitoring.coreos.com"."v1".ServiceMonitor.vrchat-prometheus-adapter = {
spec = {
selector.matchLabels.app = appName;
endpoints = [ { port = "metrics"; interval = "60s"; } ];
};
};
kubernetes.resources.services.vrchat-prometheus-adapter = {
metadata.annotations = {
"prometheus.io/port" = "6534";
"prometheus.io/scrape" = "true";
"prometheus.io/path" = "/metrics";
};
spec = {
selector.app = appName;
ports.metrics = {
port = 6534;
targetPort = 6534;
};
};
};
kubernetes.resources.deployments.vrchat-prometheus-adapter.spec = {
selector.matchLabels.app = appName;
template = {
metadata.labels.app = appName;
spec = {
volumes = {
config.configMap.name = "vrchat-prometheus-adapter";
};
containers = {
vrchat-prometheus-adapter = {
image = appImage;
imagePullPolicy = "Always";
volumeMounts = [ { name = "config"; mountPath = "/config.toml"; subPath = "config.toml"; } ];
envFrom = [ { secretRef.name = "vrchat-prometheus-adapter"; } ];
ports.metrics.containerPort = 6534;
resources = {
requests = {
cpu = "50m";
memory = "32Mi";
};
limits = {
cpu = "500m";
memory = "256Mi";
};
};
};
};
};
};
};
}