feat(minecraft): Move to separate k8s namespace

This commit is contained in:
Pim Kunis 2024-07-17 14:48:06 +02:00
parent dfe457c894
commit 5a4376f699
6 changed files with 41 additions and 40 deletions

View file

@ -72,6 +72,7 @@ Currently, the applications being deployed like this are:
- `bind9` - `bind9`
- `media` - `media`
- `traefik` - `traefik`
- `minecraft`
## Known bugs ## Known bugs

View file

@ -106,4 +106,6 @@
"${self}/kubenix-modules/media.nix" "media" "media"; "${self}/kubenix-modules/media.nix" "media" "media";
kubenix.traefik = mkDeployScriptAndManifest kubenix.traefik = mkDeployScriptAndManifest
"${self}/kubenix-modules/traefik.nix" "traefik" "kube-system"; "${self}/kubenix-modules/traefik.nix" "traefik" "kube-system";
kubenix.minecraft = mkDeployScriptAndManifest
"${self}/kubenix-modules/minecraft.nix" "minecraft" "minecraft";
}) })

View file

@ -1,7 +1,6 @@
{ {
imports = [ imports = [
# ./argo.nix # ./argo.nix
# ./minecraft.nix
./base.nix ./base.nix
./longhorn.nix ./longhorn.nix
./metallb.nix ./metallb.nix

View file

@ -76,7 +76,7 @@
inbucket = { }; inbucket = { };
dns = { }; dns = { };
media = { }; media = { };
traefik = { }; minecraft = { };
}; };
nodes = nodes =

View file

@ -1,48 +1,48 @@
{ myLib, ... }: { { myLib, ... }: {
kubernetes.resources = { # kubernetes.resources = {
configMaps.minecraft-env.data.EULA = "TRUE"; # deployments.minecraft.spec = {
# selector.matchLabels.app = "minecraft";
deployments.minecraft = { # template = {
metadata.labels.app = "minecraft"; # metadata.labels.app = "minecraft";
spec = { # spec = {
selector.matchLabels.app = "minecraft"; # volumes.data.persistentVolumeClaim.claimName = "data";
template = { # containers.minecraft = {
metadata.labels.app = "minecraft"; # image = "itzg/minecraft-server";
# ports.minecraft.containerPort = 25565;
spec = { # env.EULA.value = "TRUE";
volumes.data.persistentVolumeClaim.claimName = "minecraft";
containers.minecraft = { # volumeMounts = [{
image = "itzg/minecraft-server"; # name = "data";
envFrom = [{ configMapRef.name = "minecraft-env"; }]; # mountPath = "/data";
ports.minecraft.containerPort = 25565; # }];
# };
volumeMounts = [{ # securityContext = {
name = "data"; # fsGroup = 1000;
mountPath = "/data"; # fsGroupChangePolicy = "OnRootMismatch";
}]; # };
}; # };
# };
# };
securityContext = { # services.minecraft.spec = {
fsGroup = 1000; # type = "LoadBalancer";
fsGroupChangePolicy = "OnRootMismatch"; # loadBalancerIP = myLib.globals.minecraftIPv4;
}; # selector.app = "minecraft";
};
};
};
};
services.minecraft.spec = { # ports.minecraft = {
type = "LoadBalancer"; # port = 25565;
loadBalancerIP = myLib.globals.minecraftIPv4; # targetPort = "minecraft";
selector.app = "minecraft"; # };
# };
# };
ports.minecraft = { lab.longhorn.persistentVolumeClaim.data = {
port = 25565; volumeName = "minecraft";
targetPort = "minecraft"; storage = "1Gi";
};
};
}; };
} }

View file

@ -35,8 +35,6 @@
}; };
lab = { lab = {
longhornVolumes.minecraft.storage = "1Gi";
longhorn.persistentVolume = { longhorn.persistentVolume = {
freshrss.storage = "1Gi"; freshrss.storage = "1Gi";
radicale.storage = "200Mi"; radicale.storage = "200Mi";
@ -65,6 +63,7 @@
prowlarr.storage = "150Mi"; prowlarr.storage = "150Mi";
sonarr.storage = "150Mi"; sonarr.storage = "150Mi";
bazarr.storage = "25Mi"; bazarr.storage = "25Mi";
minecraft.storage = "1Gi";
}; };
}; };
} }