100 lines
2.1 KiB
Nix
100 lines
2.1 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";
|
|
|
|
strategy = {
|
|
type = "RollingUpdate";
|
|
|
|
rollingUpdate = {
|
|
maxSurge = 0;
|
|
maxUnavailable = 1;
|
|
};
|
|
};
|
|
|
|
template = {
|
|
metadata.labels.app = "forgejo";
|
|
|
|
spec = {
|
|
containers.forgejo = {
|
|
image = "codeberg.org/forgejo/forgejo:7.0.5";
|
|
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";
|
|
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
}
|