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; }; ports.readonly = { port = 8081; targetPort = 8081; }; }; }; 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.http.containerPort = 8080; }; nitter-ro = { image = nitterImage; imagePullPolicy = "Always"; volumeMounts = [ { name = "config"; mountPath = "/src/nitter.conf"; subPath = "nitter-ro.conf"; } { name = "accounts"; mountPath = "/src/guest_accounts.json"; subPath = "guest_accounts.json"; } ]; ports.http.containerPort = 8081; }; }; }; }; }; 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"; }; } ]; } ]; }; }; }