Nitter deployment

This commit is contained in:
Gabriel Simmer 2024-03-10 12:13:41 +00:00
parent 4f05052bd5
commit b420e41a85
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ
2 changed files with 95 additions and 0 deletions

View file

@ -21,5 +21,6 @@
(import ./conduit.nix)
(import ./irc.nix)
(import ./netboot.nix)
(import ./nitter.nix)
];
}

94
homelab/nitter.nix Normal file
View file

@ -0,0 +1,94 @@
let
appName = "nitter";
nitterImage = "git.gmem.ca/arch/nitter:latest";
in
{
lib,
config,
kubenix,
...
}: {
kubernetes.resources.services.nitter = {
spec = {
selector.app = appName;
ports.http = {
port = 8080;
targetPort = 8080;
};
};
};
kubernetes.resources.deployments.nitter.spec = {
selector.matchLabels.app = appName;
template = {
metadata.labels.app = appName;
spec = {
volumes = {
config.configMap.name = "nitter";
accounts.secret.secretName = "nitter";
};
containers = {
nitter = {
image = nitterImage;
imagePullPolicy = "Always";
volumeMounts = [
{
name = "config";
mountPath = "/src/nitter.conf";
subPath = "nitter.conf";
}
{
name = "accounts";
mountPath = "/src/guest_accounts.json";
subPath = "guest_accounts.json";
}
];
ports.tlshttp.containerPort = 8080;
};
};
};
};
};
kubernetes.helm.releases.nitter-redis = {
chart = kubenix.lib.helm.fetch {
repo = "https://charts.bitnami.com/bitnami";
chart = "redis";
version = "18.6.1";
sha256 = "CyvGHc1v1BtbzDx6hbbPah2uWpUhlNIUQowephT6hmM=";
};
values = {
auth.enabled = false;
architecture = "standalone";
};
};
kubernetes.resources.ingresses.nitter = {
metadata = {
name = appName;
annotations = {
"cert-manager.io/issuer" = "le-issuer";
};
};
spec = {
tls = [
{
hosts = ["nitter.gmem.ca"];
secretName = "gmem-ca-wildcard";
}
];
rules = [
{
host = "nitter.gmem.ca";
http.paths = [
{
path = "/";
pathType = "Prefix";
backend.service = {
name = appName;
port.name = "http";
};
}
];
}
];
};
};
}