feat(forgejo): Move to separate k8s namespace

This commit is contained in:
Pim Kunis 2024-07-14 20:14:48 +02:00
parent 17f507d277
commit f606cb2f1c
6 changed files with 59 additions and 54 deletions

View file

@ -61,6 +61,7 @@ Currently, the applications being deployed like this are:
- `nextcloud`
- `hedgedoc`
- `kitchenowl`
- `forgejo`
## Known bugs

View file

@ -82,4 +82,6 @@
"${self}/kubenix-modules/hedgedoc.nix" "hedgedoc" "hedgedoc";
kubenix.kitchenowl = mkDeployScriptAndManifest
"${self}/kubenix-modules/kitchenowl.nix" "kitchenowl" "kitchenowl";
kubenix.forgejo = mkDeployScriptAndManifest
"${self}/kubenix-modules/forgejo" "forgejo" "forgejo";
})

View file

@ -4,7 +4,6 @@ let
./syncthing.nix
./pihole.nix
./paperless.nix
./forgejo
./media.nix
./bind9
./dnsmasq.nix

View file

@ -69,6 +69,7 @@
nextcloud = { };
hedgedoc = { };
kitchenowl = { };
forgejo = { };
};
nodes =

View file

@ -1,23 +1,12 @@
{ lib, myLib, ... }: {
kubernetes.resources = {
configMaps = {
forgejo-config.data = {
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 = {
deployments.server.spec = {
selector.matchLabels.app = "forgejo";
strategy = {
@ -33,9 +22,18 @@
metadata.labels.app = "forgejo";
spec = {
# This disables services from becoming environmental variables
# to prevent SSH_PORT clashing with Forgejo config.
enableServiceLinks = false;
containers.forgejo = {
image = "codeberg.org/forgejo/forgejo:7.0.5";
envFrom = [{ configMapRef.name = "forgejo-env"; }];
imagePullPolicy = "Always";
env = {
USER_UID.value = "1000";
USER_GID.value = "1000";
};
ports = {
web.containerPort = 3000;
@ -56,16 +54,15 @@
};
volumes = {
data.persistentVolumeClaim.claimName = "forgejo";
config.configMap.name = "forgejo-config";
};
data.persistentVolumeClaim.claimName = "data";
config.configMap.name = "config";
};
};
};
};
services = {
forgejo-web.spec = {
web.spec = {
selector.app = "forgejo";
ports.web = {
@ -74,7 +71,7 @@
};
};
forgejo-ssh.spec = {
ssh.spec = {
type = "LoadBalancer";
loadBalancerIP = myLib.globals.gitIPv4;
selector.app = "forgejo";
@ -88,13 +85,18 @@
};
lab = {
ingresses.forgejo = {
ingresses.web = {
host = "git.kun.is";
service = {
name = "forgejo-web";
name = "web";
portName = "web";
};
};
longhorn.persistentVolumeClaim.data = {
volumeName = "forgejo";
storage = "20Gi";
};
};
}

View file

@ -17,7 +17,6 @@
minecraft.storage = "1Gi";
pihole-data.storage = "750Mi";
pihole-dnsmasq.storage = "16Mi";
forgejo.storage = "20Gi";
syncthing.storage = "400Mi";
paperless-data.storage = "10Gi";
paperless-redisdata.storage = "20Mi";
@ -45,6 +44,7 @@
hedgedoc-uploads.storage = "50Mi";
hedgedoc-db.storage = "100Mi";
kitchenowl.storage = "100Mi";
forgejo.storage = "20Gi";
};
nfsVolumes = {