add persistent storage to minecraft
This commit is contained in:
parent
843810dced
commit
76bd5c9276
3 changed files with 30 additions and 8 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,2 @@
|
|||
.direnv
|
||||
.terraform.lock.hcl
|
||||
.terraform
|
||||
.deploy-gc/
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
{
|
||||
kubernetes.resources = {
|
||||
configMaps = {
|
||||
minecraft-env.data = {
|
||||
EULA = "TRUE";
|
||||
};
|
||||
|
||||
};
|
||||
configMaps.minecraft-env.data.EULA = "TRUE";
|
||||
|
||||
deployments.minecraft = {
|
||||
metadata.labels.app = "minecraft";
|
||||
|
@ -20,14 +15,42 @@
|
|||
containers.minecraft = {
|
||||
image = "itzg/minecraft-server";
|
||||
envFrom = [{ configMapRef.name = "minecraft-env"; }];
|
||||
|
||||
ports = [{
|
||||
containerPort = 25565;
|
||||
protocol = "TCP";
|
||||
}];
|
||||
|
||||
volumeMounts = [{
|
||||
name = "data";
|
||||
mountPath = "/data";
|
||||
}];
|
||||
};
|
||||
|
||||
volumes = [{
|
||||
name = "data";
|
||||
persistentVolumeClaim.claimName = "minecraft";
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
|
||||
services.minecraft.spec = {
|
||||
|
|
|
@ -28,6 +28,7 @@ let
|
|||
"/prowlarr/config"
|
||||
"/sonarr/config"
|
||||
"/bazarr/config"
|
||||
"/minecraft"
|
||||
];
|
||||
|
||||
nfsExports = lib.strings.concatLines (
|
||||
|
|
Loading…
Reference in a new issue