45 lines
1 KiB
Nix
45 lines
1 KiB
Nix
{ myLib, ... }: {
|
|
kubernetes.resources = {
|
|
configMaps.minecraft-env.data.EULA = "TRUE";
|
|
|
|
deployments.minecraft = {
|
|
metadata.labels.app = "minecraft";
|
|
|
|
spec = {
|
|
selector.matchLabels.app = "minecraft";
|
|
|
|
template = {
|
|
metadata.labels.app = "minecraft";
|
|
|
|
spec = {
|
|
volumes.data.persistentVolumeClaim.claimName = "minecraft";
|
|
|
|
containers.minecraft = {
|
|
image = "itzg/minecraft-server";
|
|
envFrom = [{ configMapRef.name = "minecraft-env"; }];
|
|
ports.minecraft.containerPort = 25565;
|
|
|
|
volumeMounts = [{
|
|
name = "data";
|
|
mountPath = "/data";
|
|
}];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
services.minecraft.spec = {
|
|
type = "LoadBalancer";
|
|
loadBalancerIP = myLib.globals.minecraftIPv4;
|
|
selector.app = "minecraft";
|
|
|
|
ports.minecraft = {
|
|
port = 25565;
|
|
targetPort = "minecraft";
|
|
};
|
|
};
|
|
};
|
|
|
|
lab.nfsVolumes.minecraft.path = "minecraft";
|
|
}
|