2024-04-13 21:25:48 +00:00
|
|
|
{ myLib, ... }: {
|
2024-04-13 16:00:51 +00:00
|
|
|
kubernetes.resources = {
|
2024-04-13 20:21:26 +00:00
|
|
|
configMaps.minecraft-env.data.EULA = "TRUE";
|
2024-04-13 16:00:51 +00:00
|
|
|
|
|
|
|
deployments.minecraft = {
|
|
|
|
metadata.labels.app = "minecraft";
|
|
|
|
|
|
|
|
spec = {
|
|
|
|
selector.matchLabels.app = "minecraft";
|
|
|
|
|
|
|
|
template = {
|
|
|
|
metadata.labels.app = "minecraft";
|
|
|
|
|
|
|
|
spec = {
|
|
|
|
containers.minecraft = {
|
|
|
|
image = "itzg/minecraft-server";
|
|
|
|
envFrom = [{ configMapRef.name = "minecraft-env"; }];
|
2024-04-13 20:21:26 +00:00
|
|
|
|
2024-04-13 16:00:51 +00:00
|
|
|
ports = [{
|
|
|
|
containerPort = 25565;
|
|
|
|
protocol = "TCP";
|
|
|
|
}];
|
2024-04-13 20:21:26 +00:00
|
|
|
|
|
|
|
volumeMounts = [{
|
|
|
|
name = "data";
|
|
|
|
mountPath = "/data";
|
|
|
|
}];
|
2024-04-13 16:00:51 +00:00
|
|
|
};
|
2024-04-13 20:21:26 +00:00
|
|
|
|
|
|
|
volumes = [{
|
|
|
|
name = "data";
|
|
|
|
persistentVolumeClaim.claimName = "minecraft";
|
|
|
|
}];
|
2024-04-13 16:00:51 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-13 20:21:26 +00:00
|
|
|
persistentVolumes.minecraft.spec = {
|
|
|
|
capacity.storage = "1Mi";
|
|
|
|
accessModes = [ "ReadWriteMany" ];
|
|
|
|
|
|
|
|
nfs = {
|
|
|
|
server = "lewis.dmz";
|
|
|
|
path = "/mnt/data/nfs/minecraft";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
persistentVolumeClaims.minecraft.spec = {
|
|
|
|
accessModes = [ "ReadWriteMany" ];
|
|
|
|
storageClassName = "";
|
|
|
|
resources.requests.storage = "1Mi";
|
|
|
|
volumeName = "minecraft";
|
|
|
|
};
|
|
|
|
|
2024-04-13 16:00:51 +00:00
|
|
|
services.minecraft.spec = {
|
|
|
|
type = "LoadBalancer";
|
2024-04-13 21:25:48 +00:00
|
|
|
loadBalancerIP = myLib.globals.minecraftIPv4;
|
2024-04-13 16:00:51 +00:00
|
|
|
selector.app = "minecraft";
|
|
|
|
|
|
|
|
ports = [{
|
|
|
|
port = 25565;
|
|
|
|
targetPort = 25565;
|
|
|
|
protocol = "TCP";
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|