diff --git a/library/ix-dev/community/minecraft/Chart.lock b/library/ix-dev/community/minecraft/Chart.lock new file mode 100644 index 0000000000..087ea465af --- /dev/null +++ b/library/ix-dev/community/minecraft/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.0.6 +digest: sha256:2f1f31c15fb7f92db141a66adbb8d23a8598727730050a3883a211763a4e5472 +generated: "2023-04-25T15:26:05.856456573+03:00" diff --git a/library/ix-dev/community/minecraft/Chart.yaml b/library/ix-dev/community/minecraft/Chart.yaml new file mode 100644 index 0000000000..a585563c73 --- /dev/null +++ b/library/ix-dev/community/minecraft/Chart.yaml @@ -0,0 +1,25 @@ +name: minecraft +description: Minecraft is a sandbox game +annotations: + title: Minecraft +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: '2023.3.0' +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ + email: dev@ixsystems.com +dependencies: + - name: common + repository: file://../../../common + version: 1.0.6 +home: https://www.minecraft.net/en-us +icon: https://www.minecraft.net/content/dam/games/minecraft/logos/logo-minecraft.svg +sources: + - https://www.minecraft.net/en-us + - https://github.com/truenas/charts/tree/master/community/minecraft + - https://github.com/itzg/docker-minecraft-server +keywords: + - minecraft diff --git a/library/ix-dev/community/minecraft/README.md b/library/ix-dev/community/minecraft/README.md new file mode 100644 index 0000000000..137bad3438 --- /dev/null +++ b/library/ix-dev/community/minecraft/README.md @@ -0,0 +1,14 @@ +# Minecraft + +[Minecraft](https://www.minecraft.net/en-us) is a sandbox game + +> Application requires to run as root. + +Depending on the `Type` of server selected, you might need to add additional +custom environment variables to the application. + +More info can be found [here](https://itzg.github.io/docker-minecraft-docs/java/server-types/bukkit-spigot/) +Select the type on the sidebar. + +Note that some values are only applicable during the world generation. +More info can be found [here](https://itzg.github.io/docker-minecraft-docs/) diff --git a/library/ix-dev/community/minecraft/app-readme.md b/library/ix-dev/community/minecraft/app-readme.md new file mode 100644 index 0000000000..137bad3438 --- /dev/null +++ b/library/ix-dev/community/minecraft/app-readme.md @@ -0,0 +1,14 @@ +# Minecraft + +[Minecraft](https://www.minecraft.net/en-us) is a sandbox game + +> Application requires to run as root. + +Depending on the `Type` of server selected, you might need to add additional +custom environment variables to the application. + +More info can be found [here](https://itzg.github.io/docker-minecraft-docs/java/server-types/bukkit-spigot/) +Select the type on the sidebar. + +Note that some values are only applicable during the world generation. +More info can be found [here](https://itzg.github.io/docker-minecraft-docs/) diff --git a/library/ix-dev/community/minecraft/charts/common-1.0.6.tgz b/library/ix-dev/community/minecraft/charts/common-1.0.6.tgz new file mode 100644 index 0000000000..afbd26023c Binary files /dev/null and b/library/ix-dev/community/minecraft/charts/common-1.0.6.tgz differ diff --git a/library/ix-dev/community/minecraft/ci/java11-j9-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java11-j9-vanilla-values.yaml new file mode 100644 index 0000000000..97b90f4323 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java11-j9-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j11j9Image + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java11-jdk-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java11-jdk-vanilla-values.yaml new file mode 100644 index 0000000000..9e896e09c7 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java11-jdk-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j11jdkImage + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java11-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java11-vanilla-values.yaml new file mode 100644 index 0000000000..1276ee6396 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java11-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j11Image + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java17-alpine-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java17-alpine-vanilla-values.yaml new file mode 100644 index 0000000000..409ffca067 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java17-alpine-vanilla-values.yaml @@ -0,0 +1,12 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j17alpineImage + eula: true + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java17-gce-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java17-gce-vanilla-values.yaml new file mode 100644 index 0000000000..00a714f2e7 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java17-gce-vanilla-values.yaml @@ -0,0 +1,12 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j17gceImage + eula: true + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java17-j9-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java17-j9-vanilla-values.yaml new file mode 100644 index 0000000000..4afafbd103 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java17-j9-vanilla-values.yaml @@ -0,0 +1,12 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j17j9Image + eula: true + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java17-jdk-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java17-jdk-vanilla-values.yaml new file mode 100644 index 0000000000..c492641b95 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java17-jdk-vanilla-values.yaml @@ -0,0 +1,12 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j17jdkImage + eula: true + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java17-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java17-vanilla-values.yaml new file mode 100644 index 0000000000..83a78dfc4f --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java17-vanilla-values.yaml @@ -0,0 +1,12 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j17Image + eula: true + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java19-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java19-vanilla-values.yaml new file mode 100644 index 0000000000..57bf24dcff --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java19-vanilla-values.yaml @@ -0,0 +1,12 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j19Image + eula: true + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java8-gce-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java8-gce-vanilla-values.yaml new file mode 100644 index 0000000000..0720055c9d --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java8-gce-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j8gceImage + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java8-j9-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java8-j9-vanilla-values.yaml new file mode 100644 index 0000000000..88f87e9906 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java8-j9-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j8j9Image + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java8-jdk-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java8-jdk-vanilla-values.yaml new file mode 100644 index 0000000000..7411c27ee2 --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java8-jdk-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j8jdkImage + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/ci/java8-vanilla-values.yaml b/library/ix-dev/community/minecraft/ci/java8-vanilla-values.yaml new file mode 100644 index 0000000000..a620ca759c --- /dev/null +++ b/library/ix-dev/community/minecraft/ci/java8-vanilla-values.yaml @@ -0,0 +1,13 @@ +mcStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +mcConfig: + imageSelector: j8Image + eula: true + version: 1.16.5 + +mcNetwork: + serverPort: 30000 + rconPort: 30001 diff --git a/library/ix-dev/community/minecraft/item.yaml b/library/ix-dev/community/minecraft/item.yaml new file mode 100644 index 0000000000..72a3b37867 --- /dev/null +++ b/library/ix-dev/community/minecraft/item.yaml @@ -0,0 +1,3 @@ +icon_url: https://www.minecraft.net/content/dam/games/minecraft/logos/logo-minecraft.svg +categories: + - minecraft diff --git a/library/ix-dev/community/minecraft/metadata.yaml b/library/ix-dev/community/minecraft/metadata.yaml new file mode 100644 index 0000000000..224e96dc6f --- /dev/null +++ b/library/ix-dev/community/minecraft/metadata.yaml @@ -0,0 +1,18 @@ +runAsContext: + - userName: root + groupName: root + gid: 0 + uid: 0 + description: Minecraft requires root privileges to start the Minecraft process +capabilities: + - name: CHOWN + description: Minecraft is able to chown files. + - name: DAC_OVERRIDE + description: Minecraft is able to bypass permission checks. + - name: FOWNER + description: Minecraft is able bypass permission checks for it's sub-processes. + - name: SETGID + description: Minecraft is able to set group ID for it's sub-processes. + - name: SETUID + description: Minecraft is able to set user ID for it's sub-processes. +hostMounts: [] diff --git a/library/ix-dev/community/minecraft/questions.yaml b/library/ix-dev/community/minecraft/questions.yaml new file mode 100644 index 0000000000..d31b3807ee --- /dev/null +++ b/library/ix-dev/community/minecraft/questions.yaml @@ -0,0 +1,638 @@ +groups: + - name: Minecraft Configuration + description: Configure Minecraft + - name: User and Group Configuration + description: Configure User and Group for Minecraft + - name: Network Configuration + description: Configure Network for Minecraft + - name: Storage Configuration + description: Configure Storage for Minecraft + - name: Resources Configuration + description: Configure Resources for Minecraft + +questions: + - variable: TZ + group: Minecraft Configuration + label: Timezone + schema: + type: string + default: Etc/UTC + required: true + $ref: + - definitions/timezone + + - variable: mcConfig + label: "" + group: Minecraft Configuration + schema: + type: dict + attrs: + - variable: eula + label: EULA + description: Accept the EULA. + schema: + type: boolean + default: false + required: true + - variable: imageSelector + label: Image + description: | + The image to use for Minecraft.
+ Depending on the image you select, you might + need to adjust the Version and Type fields. + schema: + type: string + default: "j17Image" + required: true + enum: + - value: j8Image + description: Java 8 HotSpot (Alpine) + - value: j8j9Image + description: Java 8 OpenJ9 (Debian) + - value: j8jdkImage + description: Java 8 HotSpot+JDK (Ubuntu) + - value: j8gceImage + description: Java 8 GraalVM CE (Oracle) + - value: j11Image + description: Java 11 HotSpot (Ubuntu) + - value: j11j9Image + description: Java 11 OpenJ9 (Debian) + - value: j11jdkImage + description: Java 11 HotSpot+JDK (Ubuntu) + - value: j17Image + description: Java 17 HotSpot (Ubuntu) + - value: j17j9Image + description: Java 17 OpenJ9 (Debian) + - value: j17jdkImage + description: Java 17 HotSpot+JDK (Ubuntu) + - value: j17gceImage + description: Java 17 GraalVM CE (Oracle) + - value: j17alpineImage + description: Java 17 HotSpot (Alpine) + - value: j19Image + description: Java 19 HotSpot (Ubuntu) + - variable: type + label: Type + description: | + The type of Minecraft server to run.
+ Depending on the type you select, you might need + to add additional environment variables.
+ https://itzg.github.io/docker-minecraft-docs/java/server-types/bukkit-spigot + schema: + type: string + default: "VANILLA" + required: true + enum: + - value: VANILLA + description: Vanilla + - value: SPIGOT + description: Spigot + - value: BUKKIT + description: Bukkit + - value: FORGE + description: Forge + - value: CATSERVER + description: CatServer + - value: CRUCIBLE + description: Crucible + - value: AUTO_CURSEFORGE + description: Auto CurseForge + - value: CUSTOM + description: Custom + - value: FABRIC + description: Fabric + - value: FTBA + description: Feed The Beast + - value: FORGE + description: Forge + - value: LOLISERVER + description: LoliServer + - value: LIMBO + description: Limbo + - value: MAGMA + description: Magma + - value: MOHIST + description: Mohist + - value: FABRIC + description: Fabric + - value: PAPER + description: Paper + - value: PUFFERFISH + description: Pufferfish + - value: PURPUR + description: Purpur + - value: QUILT + description: Quilt + - value: SPONGEVANILLA + description: SpongeVanilla + - variable: version + label: Version + description: | + The minecraft version.
+ https://itzg.github.io/docker-minecraft-docs/java/versions/minecraft + schema: + type: string + default: "LATEST" + required: true + - variable: serverName + label: Server Name + description: | + The name of the Minecraft server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/servername + schema: + type: string + default: "Minecraft Server" + required: true + - variable: difficulty + label: Difficulty + description: | + The difficulty of the Minecraft server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/difficulty + schema: + type: string + default: "easy" + required: true + enum: + - value: peaceful + description: Peaceful + - value: easy + description: Easy + - value: normal + description: Normal + - value: hard + description: Hard + - variable: seed + label: Seed + description: | + The seed for the Minecraft server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/seed
+ (Quotes is handled by the field automatically) + schema: + type: string + default: "" + - variable: mode + label: Game Mode + description: | + The game mode of the Minecraft server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/gamemode + schema: + type: string + default: "survival" + required: true + enum: + - value: survival + description: Survival + - value: creative + description: Creative + - value: adventure + description: Adventure + - value: spectator + description: Spectator + - variable: levelType + label: Level Type + description: | + The level type of the Minecraft server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/#level-type-and-generator-settings + schema: + type: string + default: "minecraft:default" + required: true + enum: + - value: minecraft:default + description: Default + - value: minecraft:flat + description: Flat + - value: minecraft:large_biomes + description: Large Biomes + - value: minecraft:amplified + description: Amplified + - value: minecraft:single_biome_surface + description: Single Biome Surface + - value: buffet + description: Buffet + - value: customized + description: Customized + - variable: motd + label: Message of the Day + description: | + The message of the day for the Minecraft server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/motd + schema: + type: string + default: "Welcome to Minecraft on TrueNAS!" + required: true + - variable: enableRcon + label: Enable RCON + description: | + Enable RCON for the Minecraft server.
+ It is recommended to keep this enabled, as it helps to + shut down the minecraft server gracefully.
+ https://itzg.github.io/docker-minecraft-docs/java/rcon + schema: + type: boolean + default: true + - variable: rconPassword + label: RCON Password + description: The RCON password for the Minecraft server. + schema: + type: string + default: "" + show_if: [["enableRcon", "=", true]] + private: true + required: true + - variable: maxPlayers + label: Max Players + description: | + The maximum number of players that can join the server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/maxplayers + schema: + type: int + default: 20 + min: 1 + required: true + - variable: maxWorldSize + label: Max World Size + description: | + The maximum possible size in blocks, expressed as a radius.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/maxworldsize + schema: + type: int + default: 10000 + min: 1 + required: true + - variable: maxBuildHeight + label: Max Build Height + description: | + The maximum height in which building is allowed. + Terrain may still naturally generate above a low height limit.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/maxbuildheight + schema: + type: int + default: 256 + min: 1 + required: true + - variable: allowNether + label: Allow Nether + description: | + Allows players to travel to the Nether.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/allownether + schema: + type: boolean + default: true + - variable: announcePlayerAchievements + label: Announce Player Achievements + description: | + Allows server to announce when a player gets an achievement.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/announceachievements + schema: + type: boolean + default: true + - variable: enableCommandBlock + label: Enable Command Block + description: | + Enables the command blocks.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/enablecommandblock + schema: + type: boolean + default: false + - variable: forceGameMode + label: Force Game Mode + description: | + Force players to join in the default game mode.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/forcegamemode + schema: + type: boolean + default: false + - variable: generateStructures + label: Generate Structures + description: | + Defines whether structures (such as villages) will be generated.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/generatestructures + schema: + type: boolean + default: true + - variable: hardcore + label: Hardcore + description: | + If set to true, players will be set to spectator mode if they die.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/hardcore + schema: + type: boolean + default: false + - variable: spawnAnimals + label: Spawn Animals + description: | + Determines if animals will be able to spawn.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/spawnanimals + schema: + type: boolean + default: true + - variable: spawnNpcs + label: Spawn NPCs + description: | + Determines if villagers will be spawned.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/spawnnpcs + schema: + type: boolean + default: true + - variable: spawnMonsters + label: Spawn Monsters + description: | + Determines if monsters will be spawned.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/spawnmonsters + schema: + type: boolean + default: true + - variable: spawnProtection + label: Spawn Protection + description: | + The radius of the spawn protection.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/spawnprotection + schema: + type: int + default: 16 + min: 0 + required: true + - variable: pvp + label: PVP + description: | + Determines if PVP will be enabled.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/pvp + schema: + type: boolean + default: true + - variable: allowFlight + label: Allow Flight + description: | + Allows users to use flight on your server while in Survival mode, + if they have a mod that provides flight installed.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/allowflight + schema: + type: boolean + default: false + - variable: viewDistance + label: View Distance + description: | + Sets the amount of world data the server sends the client, + measured in chunks in each direction of the player (radius, not diameter). + It determines the server-side viewing distance.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/viewdistance + schema: + type: int + default: 10 + min: 3 + max: 32 + required: true + - variable: onlineMode + label: Online Mode + description: | + If set to true, the server will attempt to authenticate clients + connecting to it with the Minecraft account database.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/onlinemode + schema: + type: boolean + default: true + - variable: maxTickTime + label: Max Tick Time + description: | + The maximum number of milliseconds a single tick may take + before the server watchdog stops the server with the message, + A single server tick took 60.00 seconds (should be max 0.05); + Considering it to be crashed, server will forcibly shutdown.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/maxticktime + schema: + type: int + default: 60000 + min: 0 + required: true + - variable: ops + label: Operators / Administrators + description: | + A list of player names who should be considered operators.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/ops + schema: + type: list + default: [] + items: + - variable: opPlayer + label: OP Player + schema: + type: string + default: "" + required: true + - variable: whitelist + label: Whitelist + description: | + A list of player names who are allowed to play on the server.
+ https://itzg.github.io/docker-minecraft-docs/java/configuration/whitelist + schema: + type: list + default: [] + items: + - variable: whitePlayer + label: Whitelisted Player + schema: + type: string + default: "" + required: true + - variable: additionalEnvs + label: Additional Environment Variables + description: Configure additional environment variables for Minecraft. + schema: + type: list + default: [] + items: + - variable: env + label: Environment Variable + schema: + type: dict + attrs: + - variable: name + label: Name + schema: + type: string + required: true + - variable: value + label: Value + schema: + type: string + required: true + - variable: mcID + label: "" + group: User and Group Configuration + schema: + type: dict + attrs: + - variable: user + label: User ID + description: The user id that Minecraft files will be owned by. + schema: + type: int + min: 568 + default: 568 + required: true + - variable: group + label: Group ID + description: The group id that Minecraft files will be owned by. + schema: + type: int + min: 568 + default: 568 + required: true + + - variable: mcNetwork + label: "" + group: Network Configuration + schema: + type: dict + attrs: + - variable: hostNetwork + label: Host Network + description: | + Bind to the host network. It's recommended to keep this disabled.
+ schema: + type: boolean + default: false + - variable: serverPort + label: Server Port + description: | + The port for the Minecraft Server.
+ This will apply to both external and internal ports. + schema: + type: int + default: 25535 + min: 9000 + max: 65535 + required: true + - variable: rconPort + label: RCON Port + description: | + The RCON port for the Minecraft.
+ This will apply to both external and internal ports. + schema: + type: int + default: 25575 + min: 9000 + max: 65535 + required: true + + - variable: mcStorage + label: "" + group: Storage Configuration + schema: + type: dict + attrs: + - variable: data + label: Minecraft Data Storage + description: The path to store Minecraft Data. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: "ixVolume" + enum: + - value: "hostPath" + description: Host Path (Path that already exists on the system) + - value: "ixVolume" + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: "data" + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: additionalStorages + label: Additional Storage + description: Additional storage for Minecraft. + schema: + type: list + default: [] + items: + - variable: storageEntry + label: Storage Entry + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: "ixVolume" + enum: + - value: "hostPath" + description: Host Path (Path that already exists on the system) + - value: "ixVolume" + description: ixVolume (Dataset created automatically by the system) + - variable: mountPath + label: Mount Path + description: The path inside the container to mount the storage. + schema: + type: path + required: true + - variable: hostPath + label: Host Path + description: The host path to use for storage. + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + required: true + - variable: datasetName + label: Dataset Name + description: The name of the dataset to use for storage. + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + immutable: true + default: "storage_entry" + $ref: + - "normalize/ixVolume" + + - variable: resources + group: Resources Configuration + label: "" + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpu + label: CPU + description: CPU limit for Minecraft. + schema: + type: string + default: "4000m" + required: true + - variable: memory + label: Memory + description: Memory limit for Minecraft. + schema: + type: string + default: "8Gi" + required: true diff --git a/library/ix-dev/community/minecraft/templates/NOTES.txt b/library/ix-dev/community/minecraft/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/library/ix-dev/community/minecraft/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/library/ix-dev/community/minecraft/templates/_configuration.tpl b/library/ix-dev/community/minecraft/templates/_configuration.tpl new file mode 100644 index 0000000000..b2b020b64e --- /dev/null +++ b/library/ix-dev/community/minecraft/templates/_configuration.tpl @@ -0,0 +1,83 @@ +{{- define "minecraft.configuration" -}} +{{- include "minecraft.validation" $ }} +configmap: + minecraft-config: + enabled: true + data: + {{/* + There is no GUI in the container, + but some old versions think that there is + */}} + GUI: "FALSE" + EULA: {{ .Values.mcConfig.eula | quote | upper }} + ENABLE_RCON: {{ .Values.mcConfig.enableRcon | quote | upper }} + SERVER_PORT: {{ .Values.mcNetwork.serverPort | quote }} + {{ if .Values.mcConfig.enableRcon }} + RCON_PORT: {{ .Values.mcNetwork.rconPort | quote }} + RCON_PASSWORD: {{ .Values.mcConfig.rconPassword | quote }} + {{ end }} + VERSION: {{ .Values.mcConfig.version | quote }} + TYPE: {{ .Values.mcConfig.type | quote }} + {{ with .Values.mcConfig.seed }} + SEED: {{ . | quote }} + {{ end }} + MOTD: {{ .Values.mcConfig.motd | quote }} + DIFFICULTY: {{ .Values.mcConfig.difficulty | quote }} + SERVER_NAME: {{ .Values.mcConfig.serverName | quote }} + MAX_PLAYERS: {{ .Values.mcConfig.maxPlayers | quote }} + MAX_WORLD_SIZE: {{ .Values.mcConfig.maxWorldSize | quote }} + ALLOW_NETHER: {{ .Values.mcConfig.allowNether | quote | upper }} + ANNOUNCE_PLAYER_ACHIEVEMENTS: {{ .Values.mcConfig.announcePlayerAchievements | quote | upper }} + ENABLE_COMMAND_BLOCK: {{ .Values.mcConfig.enableCommandBlock | quote | upper }} + FORCE_GAMEMODE: {{ .Values.mcConfig.forceGameMode | quote | upper }} + GENERATE_STRUCTURES: {{ .Values.mcConfig.generateStructures | quote | upper }} + HARDCORE: {{ .Values.mcConfig.hardcore | quote | upper }} + MAX_BUILD_HEIGHT: {{ .Values.mcConfig.maxBuildHeight | quote }} + SPAWN_ANIMALS: {{ .Values.mcConfig.spawnAnimals | quote | upper }} + SPAWN_MONSTERS: {{ .Values.mcConfig.spawnMonsters | quote | upper }} + SPAWN_NPCS: {{ .Values.mcConfig.spawnNpcs | quote | upper }} + SPAWN_PROTECTION: {{ .Values.mcConfig.spawnProtection | quote }} + VIEW_DISTANCE: {{ .Values.mcConfig.viewDistance | quote }} + PVP: {{ .Values.mcConfig.pvp | quote | upper }} + LEVEL_TYPE: {{ .Values.mcConfig.levelType | quote }} + ALLOW_FLIGHT: {{ .Values.mcConfig.allowFlight | quote | upper }} + ONLINE_MODE: {{ .Values.mcConfig.onlineMode | quote | upper }} + MAX_TICK_TIME: {{ .Values.mcConfig.maxTickTime | quote }} + {{ with .Values.mcConfig.ops }} + OPS: {{ join "," . | quote }} + {{ end }} + {{ with .Values.mcConfig.whitelist }} + WHITELIST: {{ join "," . | quote }} + {{ end }} +{{- end -}} + +{{- define "minecraft.validation" -}} + {{- if not .Values.mcConfig.eula -}} + {{- fail "Minecraft - You have to accept EULA" -}} + {{- end -}} + + {{- $types := (list "VANILLA" "SPIGOT" "BUKKIT" "CATSERVER" "CRUCIBLE" + "AUTO_CURSEFORGE" "CUSTOM" "FABRIC" "FTBA" "FORGE" + "LOLISERVER" "LIMBO" "MAGMA" "MOHIST" "FABRIC" "PAPER" + "PUFFERFISH" "PURPUR" "QUILT") -}} + {{- if not (mustHas .Values.mcConfig.type $types) -}} + {{- fail (printf "Minecraft - Expected [Type] to be one of [%s], but got [%s]" (join ", " $types) .Values.mcConfig.type) -}} + {{- end -}} + + {{- $difficulties := (list "peaceful" "easy" "normal" "hard") -}} + {{- if not (mustHas .Values.mcConfig.difficulty $difficulties) -}} + {{- fail (printf "Minecraft - Expected [Difficulty] to be one of [%s], but got [%s]" (join ", " $difficulties) .Values.mcConfig.difficulty) -}} + {{- end -}} + + {{- $modes := (list "creative" "survival" "adventure" "spectator") -}} + {{- if not (mustHas .Values.mcConfig.mode $modes) -}} + {{- fail (printf "Minecraft - Expected [Mode] to be one of [%s], but got [%s]" (join ", " $modes) .Values.mcConfig.mode) -}} + {{- end -}} + + {{- $lvlTypes := (list "minecraft:default" "minecraft:flat" "minecraft:large_biomes" + "minecraft:amplified" "minecraft:single_biome_surface" "buffet" "customized") -}} + {{- if not (mustHas .Values.mcConfig.levelType $lvlTypes) -}} + {{- fail (printf "Minecraft - Expected [Level Type] to be one of [%s], but got [%s]" (join ", " $lvlTypes) .Values.mcConfig.levelType) -}} + {{- end -}} + +{{- end -}} diff --git a/library/ix-dev/community/minecraft/templates/_minecraft.tpl b/library/ix-dev/community/minecraft/templates/_minecraft.tpl new file mode 100644 index 0000000000..6d50a6ce5d --- /dev/null +++ b/library/ix-dev/community/minecraft/templates/_minecraft.tpl @@ -0,0 +1,98 @@ +{{- define "minecraft.workload" -}} +workload: + minecraft: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: {{ .Values.mcNetwork.hostNetwork }} + securityContext: + fsGroup: {{ .Values.mcID.group }} + containers: + minecraft: + enabled: true + primary: true + tty: true + stdin: true + imageSelector: {{ .Values.mcConfig.imageSelector }} + securityContext: + runAsUser: 0 + runAsGroup: 0 + readOnlyRootFilesystem: false + runAsNonRoot: false + capabilities: + add: + - CHOWN + - DAC_OVERRIDE + - FOWNER + - SETUID + - SETGID + fixedEnv: + PUID: {{ .Values.mcID.user }} + envFrom: + - configMapRef: + name: minecraft-config + {{ with .Values.mcConfig.additionalEnvs }} + envList: + {{ range $env := . }} + - name: {{ $env.name }} + value: {{ $env.value }} + {{ end }} + {{ end }} + probes: + liveness: + enabled: true + type: exec + command: mc-health + readiness: + enabled: true + type: exec + command: mc-health + startup: + enabled: true + type: exec + command: mc-health + initialDelaySeconds: 120 +{{/* Service */}} +service: + minecraft: + enabled: true + primary: true + type: NodePort + targetSelector: minecraft + ports: + server: + enabled: true + primary: true + port: {{ .Values.mcNetwork.serverPort }} + nodePort: {{ .Values.mcNetwork.serverPort }} + targetSelector: minecraft + rcon: + enabled: {{ .Values.mcConfig.enableRcon }} + port: {{ .Values.mcNetwork.rconPort }} + nodePort: {{ .Values.mcNetwork.rconPort }} + targetSelector: minecraft + +{{/* Persistence */}} +persistence: + data: + enabled: true + type: {{ .Values.mcStorage.data.type }} + datasetName: {{ .Values.mcStorage.data.datasetName | default "" }} + hostPath: {{ .Values.mcStorage.data.hostPath | default "" }} + targetSelector: + minecraft: + minecraft: + mountPath: /data + {{- range $idx, $storage := .Values.mcStorage.additionalStorages }} + {{ printf "mc-%v" (int $idx) }}: + enabled: true + type: {{ $storage.type }} + datasetName: {{ $storage.datasetName | default "" }} + hostPath: {{ $storage.hostPath | default "" }} + targetSelector: + minecraft: + minecraft: + mountPath: {{ $storage.mountPath }} + {{- end }} +{{- end -}} diff --git a/library/ix-dev/community/minecraft/templates/common.yaml b/library/ix-dev/community/minecraft/templates/common.yaml new file mode 100644 index 0000000000..bcda9c575c --- /dev/null +++ b/library/ix-dev/community/minecraft/templates/common.yaml @@ -0,0 +1,7 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "minecraft.configuration" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "minecraft.workload" $ | fromYaml) -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/library/ix-dev/community/minecraft/upgrade_info.json b/library/ix-dev/community/minecraft/upgrade_info.json new file mode 100644 index 0000000000..767388094a --- /dev/null +++ b/library/ix-dev/community/minecraft/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "values.yaml", "keys": ["image"]} diff --git a/library/ix-dev/community/minecraft/upgrade_strategy b/library/ix-dev/community/minecraft/upgrade_strategy new file mode 100755 index 0000000000..41e9448b21 --- /dev/null +++ b/library/ix-dev/community/minecraft/upgrade_strategy @@ -0,0 +1,31 @@ +#!/usr/bin/python3 +import json +import re +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +RE_STABLE_VERSION = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+') + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} + version = semantic_versioning(list(tags)) + if not version: + return {} + + return { + 'tags': {key: tags[version]}, + 'app_version': version, + } + + +if __name__ == '__main__': + try: + versions_json = json.loads(sys.stdin.read()) + except ValueError: + raise ValueError('Invalid json specified') + + print(json.dumps(newer_mapping(versions_json))) diff --git a/library/ix-dev/community/minecraft/values.yaml b/library/ix-dev/community/minecraft/values.yaml new file mode 100644 index 0000000000..54d8e2fdd2 --- /dev/null +++ b/library/ix-dev/community/minecraft/values.yaml @@ -0,0 +1,105 @@ +j8Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java8' +j8gceImage: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java8-graalvm-ce' +j8j9Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java8-openj9' +j8jdkImage: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java8-jdk' +j11Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java11' +j11j9Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java11-openj9' +j11jdkImage: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java11-jdk' +j17Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java17' +j17j9Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java17-openj9' +j17jdkImage: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java17-jdk' +j17gceImage: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java17-graalvm-ce' +j17alpineImage: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java17-alpine' +j19Image: + repository: itzg/minecraft-server + pullPolicy: IfNotPresent + tag: '2023.3.0-java19' + +resources: + limits: + cpu: 4000m + memory: 8Gi + +mcConfig: + eula: false + imageSelector: j17Image + version: LATEST + type: VANILLA + serverName: Minecraft Server + seed: '' + mode: survival + levelType: minecraft:default + difficulty: easy + pvp: true + motd: Welcome to Minecraft on TrueNAS! + enableRcon: false + rconPassword: '' + maxPlayers: 20 + maxWorldSize: 10000 + allowNether: true + announcePlayerAchievements: true + enableCommandBlock: false + forceGameMode: false + generateStructures: true + hardcore: false + maxBuildHeight: 256 + spawnAnimals: true + spawnMonsters: true + spawnNpcs: true + spawnProtection: 16 + viewDistance: 10 + allowFlight: false + onlineMode: true + maxTickTime: 60000 + ops: [] + whitelist: [] + additionalEnvs: [] +mcID: + user: 568 + group: 568 +mcNetwork: + hostNetwork: false + serverPort: 25565 + rconPort: 25575 +mcStorage: + data: + type: ixVolume + hostPath: '' + datasetName: data + additionalStorages: []