Init
This commit is contained in:
commit
cdec5a64aa
44 changed files with 9802 additions and 0 deletions
52
modules/minecraft.nix
Normal file
52
modules/minecraft.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ lib, config, globals, ... }: {
|
||||
options.minecraft.enable = lib.mkEnableOption "minecraft";
|
||||
|
||||
config = lib.mkIf config.minecraft.enable {
|
||||
kubernetes.resources = {
|
||||
deployments.minecraft.spec = {
|
||||
selector.matchLabels.app = "minecraft";
|
||||
|
||||
template = {
|
||||
metadata.labels.app = "minecraft";
|
||||
|
||||
spec = {
|
||||
volumes.data.persistentVolumeClaim.claimName = "data";
|
||||
|
||||
containers.minecraft = {
|
||||
image = globals.images.minecraft;
|
||||
ports.minecraft.containerPort = 25565;
|
||||
|
||||
env.EULA.value = "TRUE";
|
||||
|
||||
volumeMounts = [{
|
||||
name = "data";
|
||||
mountPath = "/data";
|
||||
}];
|
||||
};
|
||||
|
||||
securityContext = {
|
||||
fsGroup = 1000;
|
||||
fsGroupChangePolicy = "OnRootMismatch";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.minecraft.spec = {
|
||||
type = "LoadBalancer";
|
||||
loadBalancerIP = globals.minecraftIPv4;
|
||||
selector.app = "minecraft";
|
||||
|
||||
ports.minecraft = {
|
||||
port = 25565;
|
||||
targetPort = "minecraft";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lab.longhorn.persistentVolumeClaim.data = {
|
||||
volumeName = "minecraft";
|
||||
storage = "1Gi";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue