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`
- `media`
- `traefik`
- `minecraft`
## Known bugs

View file

@ -106,4 +106,6 @@
"${self}/kubenix-modules/media.nix" "media" "media";
kubenix.traefik = mkDeployScriptAndManifest
"${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 = [
# ./argo.nix
# ./minecraft.nix
./base.nix
./longhorn.nix
./metallb.nix

View file

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

View file

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

View file

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