nixos-servers/kubenix-modules/minecraft.nix

49 lines
1.1 KiB
Nix
Raw Permalink Normal View History

{ myLib, ... }: {
kubernetes.resources = {
2024-04-13 20:21:26 +00:00
configMaps.minecraft-env.data.EULA = "TRUE";
deployments.minecraft = {
metadata.labels.app = "minecraft";
spec = {
selector.matchLabels.app = "minecraft";
template = {
metadata.labels.app = "minecraft";
spec = {
2024-04-14 19:00:15 +00:00
volumes.data.persistentVolumeClaim.claimName = "minecraft";
containers.minecraft = {
image = "itzg/minecraft-server";
envFrom = [{ configMapRef.name = "minecraft-env"; }];
2024-04-14 19:43:31 +00:00
ports.minecraft.containerPort = 25565;
2024-04-13 20:21:26 +00:00
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
};
2024-05-21 18:41:24 +00:00
securityContext = {
fsGroup = 1000;
fsGroupChangePolicy = "OnRootMismatch";
};
};
};
};
};
services.minecraft.spec = {
type = "LoadBalancer";
loadBalancerIP = myLib.globals.minecraftIPv4;
selector.app = "minecraft";
2024-04-14 19:43:31 +00:00
ports.minecraft = {
port = 25565;
2024-04-14 19:43:31 +00:00
targetPort = "minecraft";
};
};
};
}