nixos-servers/kubenix-modules/forgejo/default.nix
Pim Kunis 1e894a8672 Remove forgejo runner
Migrate forgejo data to longhorn
2024-05-23 21:07:32 +02:00

102 lines
2.2 KiB
Nix

{ lib, myLib, ... }: {
kubernetes.resources = {
configMaps = {
forgejo-config.data = {
config = lib.generators.toINI { } (import ./config.nix);
};
forgejo-env.data = {
USER_UID = "1000";
USER_GID = "1000";
};
};
deployments = {
forgejo = {
metadata.labels = {
app = "forgejo";
component = "forgejo";
};
spec = {
selector.matchLabels = {
app = "forgejo";
component = "forgejo";
};
template = {
metadata.labels = {
app = "forgejo";
component = "forgejo";
};
spec = {
containers.forgejo = {
image = "codeberg.org/forgejo/forgejo:7.0.1";
envFrom = [{ configMapRef.name = "forgejo-env"; }];
ports = {
web.containerPort = 3000;
ssh.containerPort = 22;
};
volumeMounts = [
{
name = "data";
mountPath = "/data";
}
{
name = "config";
mountPath = "/data/gitea/conf/app.ini";
subPath = "config";
}
];
};
volumes = {
data.persistentVolumeClaim.claimName = "forgejo";
config.configMap.name = "forgejo-config";
};
};
};
};
};
};
services = {
forgejo-web.spec = {
selector = {
app = "forgejo";
component = "forgejo";
};
ports.web = {
port = 80;
targetPort = "web";
};
};
forgejo-ssh.spec = {
type = "LoadBalancer";
loadBalancerIP = myLib.globals.gitIPv4;
selector.app = "forgejo";
ports.ssh = {
port = 56287;
targetPort = "ssh";
};
};
};
};
lab = {
ingresses.forgejo = {
host = "git.kun.is";
service = {
name = "forgejo-web";
portName = "web";
};
};
};
}