GithubHelp home page GithubHelp logo

minecraft-server-charts's Introduction

minecraft-server-charts

Usage

Helm must be installed to use the charts. Please refer to Helm's documentation to get started.

Once Helm is set up properly, add the repo as follows:

helm repo add itzg https://itzg.github.io/minecraft-server-charts/

You can then run helm search repo itzg to see the charts.

Charts

helm install --name your-release itzg/minecraft

Also see artifact hub for a complete list.

minecraft-server-charts's People

Contributors

albertrdixon avatar allanger avatar bibz87 avatar billimek avatar chipwolf avatar eaglesemanation avatar gilesknap avatar hrntknr avatar hyperbolic2346 avatar ishioni avatar itzg avatar jltobler avatar josephshanak avatar jurgenweber avatar kingkeithc avatar kristopherkram avatar merkinbob avatar moergj avatar robbilie avatar roolo avatar rounndel avatar rtrox avatar savepointsam avatar sfxworks avatar toddejohnson avatar tuxpeople avatar tuxprogrammer avatar uhthomas avatar wlritchi avatar zetneteork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minecraft-server-charts's Issues

rclone backup writes to root directory instead of mounted emptyDir

Context

This chart creates an emptyDir (or, if backup persistence is enabled, a PVC) mount at the location given by destDir. Kubernetes sets the filesystem permissions automatically so that tar backups can be written to this directory.

The destDir option is doing double duty; for rclone backups, it also specifies the location within the rclone bucket where backups will be uploaded.

Issue

When rclone is selected as the backup method, the backup tar file is temporarily written to disk before being uploaded. However, the file is written in the current working directory, which defaults to /. On some (all?) Kubernetes providers, the root directory is not writable to containers that have dropped privileges, so unless the container has been set to run as root, the temporary file cannot be written, and the backup fails.

There's a few options for fixes:

  1. Either this chart or the mc-backup Dockerfile should be updated to set the working directory to destDir; or
  2. The script should be updated to write rclone temporary files to destDir; and/or
  3. A new parameter should be added to disambiguate "backup working directory" from "rclone destination path".

It feels cleanest to decouple the two uses of destDir, but doing so could also be a breaking change for people who have rclone backup already working via a root-privileged container.

CURSEFORGE support?

Howdy, Is Curseforge support possible? One of the main issues of the normal container is that the modpack file needs to be downloaded and preloaded with TYPE=CURSEFORGE and CF_SERVER_MOD within the container's filesystem.

Perhaps, part of the template is to generate a job or cronjob that could wget a file specified by the helm chart, The container should continue to fallback untill the modpack zip is downloaded.

Any additional input? Still rather new to k8s and helm charts in general.

whitelisting is very unclear

The values.yaml says to have a comma separated list of usernames, but the docker container seems to expect true/false with whiltelist in whitelist.json. The chart implies it will turn on whitelisting and generate this json file, but that doesn't seem to be the case. I would suggest either to update the docs to indicate how to turn on whitelisting and mention the json file needs to be filled out or to make the chart write the whitelist.json on start with an init container or the like.

[minecraft] allow valueFrom for extraEnv

I have a couple of use cases that require me to inject extra environment variables which require the use of valueFrom.

This could be implemented into the chart by exposing an additional variable that accepts the full deployment spec.template.spec.containers[].env syntax. This would only require a minor release.

someNewExtraEnvVariable:
  - name: NORMAL_VAR
    value: "foobar"
  - name: HOST_IP
    valueFrom:
      fieldRef:
        fieldPath: status.hostIP

Alternatively, the less messy but slightly less user-friendly option would be to allow the full use of the syntax with the extraEnv variable, this would likely be a breaking change unless someone can think up the logic to allow this kind of syntax:

extraEnv:
  USE_AIKARS_FLAGS: "true"
  HOST_IP:
    valueFrom:
      fieldRef:
        fieldPath: status.hostIP

Thoughts?

Spigot configuration

Thank you for this HELM chart, it's working great for me..

I'd like to run a Spigot server, and can't seem to make it work, and am looking for a little help.

I adjusted the values.yaml file with the following:

version:  SPIGOT

spigotDownloadUrl; https://cdn.getbukkit.org/spigot/spigot-1.16.4.jar

doesn't download and hence I only get crashloopbackoffs.

Any docs around this would be great! I'll check your Dockerfile in the mean time :)

Thanks again for the work on this!

Thoughts on restoring worlds?

Thanks again for this Chart, working great.

The kubectl cp backup example for backing it up, but will the reverse work for a restore?

Thanks

Deployment into K8s 1.19.3

Will look into this further, just putting this here for documentation. Getting this error...

Error: Deployment in version "v1" cannot be handled as a Deployment: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects " or n, but found 2, error found in #10 byte of ...|,"value":25565}],"im|..., bigger context ...|RY","value":"true"},{"name":"QUERY_PORT","value":25565}],"image":"itzg/minecraft-server:latest","ima|...

With the following values file...

image: itzg/minecraft-server
imageTag: latest
imagePullSecret: ""

minecraftServer:
  # This must be overridden, since we can't accept this for the user.
  eula: "TRUE"
  # One of: LATEST, SNAPSHOT, or a specific version (ie: "1.7.9").
  version: "LATEST"
  # This can be one of "VANILLA", "FORGE", "SPIGOT", "BUKKIT", "PAPER", "FTBA", "SPONGEVANILLA"
  type: "PAPER"
  # If type is set to FORGE, this sets the version; this is ignored if forgeInstallerUrl is set
  forgeVersion:
  # If type is set to SPONGEVANILLA, this sets the version
  spongeVersion:
  # If type is set to FORGE, this sets the URL to download the Forge installer
  forgeInstallerUrl:
  # If type is set to BUKKIT, this sets the URL to download the Bukkit package
  bukkitDownloadUrl:
  # If type is set to SPIGOT, this sets the URL to download the Spigot package
  spigotDownloadUrl:
  # If type is set to PAPER, this sets the URL to download the PaperSpigot package
  paperDownloadUrl:
  # If type is set to FTB, this sets the server mod to run. You can also provide the URL to download the FTB package
  ftbServerMod:
  # Set to true if running Feed The Beast and get an error like "unable to launch forgemodloader"
  ftbLegacyJavaFixer: false
  # One of: peaceful, easy, normal, and hard
  difficulty: hard
  # A comma-separated list of player names to whitelist.
  whitelist:
  # A comma-separated list of player names who should be admins.
  ops: "nctiggy"
  # A server icon URL for server listings. Auto-scaled and transcoded.
  icon:
  # Max connected players.
  maxPlayers: 30
  # This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
  maxWorldSize: 10000000
  # Allows players to travel to the Nether.
  allowNether: true
  # Allows server to announce when a player gets an achievement.
  announcePlayerAchievements: true
  # Enables command blocks.
  enableCommandBlock: true
  # If true, players will always join in the default gameMode even if they were previously set to something else.
  forcegameMode: true
  # Defines whether structures (such as villages) will be generated.
  generateStructures: true
  # If set to true, players will be set to spectator mode if they die.
  hardcore: false
  # The maximum height in which building is allowed.
  maxBuildHeight: 256
  # The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message. -1 disables this entirely.
  maxTickTime: 60000
  # Determines if animals will be able to spawn.
  spawnAnimals: true
  # Determines if monsters will be spawned.
  spawnMonsters: true
  # Determines if villagers will be spawned.
  spawnNPCs: true
  # Max view distance (in chunks).
  viewDistance: 10
  # Define this if you want a specific map generation seed.
  levelSeed:
  # One of: creative, survival, adventure, spectator
  gameMode: survival
  # Message of the Day
  motd: "Welcome to Minecraft on Kubernetes!"
  # If true, enable player-vs-player damage.
  pvp: true
  # One of: DEFAULT, FLAT, LARGEBIOMES, AMPLIFIED, CUSTOMIZED
  levelType: DEFAULT
  # When levelType == FLAT or CUSTOMIZED, this can be used to further customize map generation.
  # ref: https://hub.docker.com/r/itzg/minecraft-server/
  generatorSettings:
  worldSaveName: world
  # If set, this URL will be downloaded at startup and used as a starting point
  downloadWorldUrl:
  # force re-download of server file
  forceReDownload: false
  # If set, the modpack at this URL will be downloaded at startup
  downloadModpackUrl:
  # If true, old versions of downloaded mods will be replaced with new ones from downloadModpackUrl
  removeOldMods: false
  # Check accounts against Minecraft account service.
  onlineMode: false
  # If you adjust this, you may need to adjust resources.requests above to match.
  memory: 4096M
  # General JVM options to be passed to the Minecraft server invocation
  jvmOpts: ""
  # Options like -X that need to proceed general JVM options
  jvmXXOpts: ""
  serviceAnnotations: {}
  serviceType: ClusterIP
  ## Set the port used if the serviceType is NodePort
  # nodePort:
  loadBalancerIP:
  # loadBalancerSourceRanges: []
  ## Set the externalTrafficPolicy in the Service to either Cluster or Local
  # externalTrafficPolicy: Cluster
  externalIPs:

  rcon:
    # If you enable this, make SURE to change your password below.
    enabled: true
    port: 25575
    password: "CHANGEME!"
    serviceType: LoadBalancer
    loadBalancerIP:
    # loadBalancerSourceRanges: []
    ## Set the externalTrafficPolicy in the Service to either Cluster or Local
    # externalTrafficPolicy: Cluster


  query:
    # If you enable this, your server will be "published" to Gamespy
    enabled: true
    port: 25565

persistence:
  ## minecraft data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # storageClass: "-"
  dataDir:
    # Set this to false if you don't care to persist state between restarts.
    enabled: true
    existingClaim: minecraft-data

No license

Is the lack of license intentional on this repo?

Minecraft server chart doesn't set FTP_MODPACK_ID

When trying to use the Minecraft chart with the type set to FTBA there is no place to set the FTB_MODPACK_ID which caused the container to fail with

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx 2 0 0 4096 Mar 21 22:02 /data'
[init] Resolved version given LATEST into 1.18.2 and major version 1.18
[init] Resolving type given FTBA
[init] ERROR FTB_MODPACK_ID is required with TYPE=FTB

There is an option for minecraftServer.ftbServerMod but that doesn't set the FTB_MODPACK_ID environment variable. You can set the variable in the extraEnv section and everything works fine, but it isn't obvious.

Installing Plugins currently only via file copy to persistent storage

Feature proposal
Add the functionality to configure a list (list of downloadUrls, or even Spigot Plugin names, tbd) of Pugins, that are downloaded and stored to the correct directory before starting the minecraft server.

Input appreciated
I currently don't know how the URLs for downloading plugin jars on spigot can be used, as the URLs are not leading to the file directly. I thought of a solution based on this: https://github.com/InventivetalentDev/SpigetDownloader

I will look into this this evening and try to provide a PR.

extraVolumes: volumeMounts causes null in output for deployment volumes.

I am trying to add extraVolumes to attach an nfs share. When I have volumes and volumeMounts in extraVolumes, I am getting a null string in the output. I did a few tests and it looks like the issue is the helm chart - specifically the area that is adding volumes. When looping through extraVolumes, each volumeMount element will show as null.

This should be a simple fix - only loop and add volumes from extraVolumes.

With volumeMounts in extra volumes.

values.yaml

minecraftServer:
  serviceType: LoadBalancer
  eula: true
  type: "CURSEFORGE"
  cfServerMod: "/modpacks/All+the+Mods+6+-+To+the+Sky+-1.2.0.zip"

persistence:
  storageClass: cstor-csi-disk
  dataDir:
    enabled: true
    Size: 5Gi

extraVolumes:
  - volumeMounts:
      - name: modpacks
        mountPath: "/modpacks"
        readOnly: true
  - volumes:
      - name: modpacks
        nfs:
          server: nfs-server
          path: "/nfs/modpacks"

Running helm template --debug

helm template minecraft --values minecraft_values.yaml minecraft-server-charts/minecraft --debug > template.out
install.go:178: [debug] Original chart version: ""
install.go:195: [debug] CHART PATH: /root/.cache/helm/repository/minecraft-3.8.2.tgz

Error: YAML parse error on minecraft/templates/deployment.yaml: error converting YAML to JSON: yaml: line 145: could not find expected ':'
helm.go:84: [debug] error converting YAML to JSON: yaml: line 145: could not find expected ':'
YAML parse error on minecraft/templates/deployment.yaml

out.yaml

       volumeMounts:
        - name: datadir
          mountPath: /data
        - name: backupdir
          mountPath: /backups
          readOnly: true
        - mountPath: /modpacks
          name: modpacks
          readOnly: true
      volumes:
      - name: datadir
        persistentVolumeClaim:
          claimName: minecraft-1-minecraft-datadir
      - name: backupdir
        emptyDir: {}
      null
      - name: modpacks
        nfs:
          path: /nfs/modpacks
          server: nfs-server

After removing the volumeMounts from extraVolumes:

values.yaml

minecraftServer:
  serviceType: LoadBalancer
  eula: true
  type: "CURSEFORGE"
  cfServerMod: "/modpacks/All+the+Mods+6+-+To+the+Sky+-1.2.0.zip"

persistence:
  storageClass: cstor-csi-disk
  dataDir:
    enabled: true
    Size: 5Gi

extraVolumes:
  - volumes:
      - name: modpacks
        nfs:
          server: nfs-server
          path: "/nfs/modpacks"

out.yaml

        volumeMounts:
        - name: datadir
          mountPath: /data
        - name: backupdir
          mountPath: /backups
          readOnly: true
      volumes:
      - name: datadir
        persistentVolumeClaim:
          claimName: minecraft-minecraft-datadir
      - name: backupdir
        emptyDir: {}
      - name: modpacks
        nfs:
          path: /nfs/modpacks
          server: nfs-server

Default version update?

I petition that we should release a new chart version with an updated app version 1.16.1 is out, and we are still defaulting to 1.14.4. I am happy to submit a PR, but before I do, I wanted to see if there was some reason why we were still defaulting to 1.14.4.

No Auto Pause in Helm Chart

The helm chart does not have any ENABLE_AUTOPAUSE option though the base image supports it. Am I missing something?

Java error when launching FTB Sky Odyssey

I'm having an issue starting a new server for FTB Sky Odyssey

K8s version: 1.20.4:
Host version: Ubuntu 20.04

chmod: changing permissions of '/data': Operation not permitted
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx 8 0 0 4096 Apr 15 01:13 /data'
[init] Resolved version given 1.12.2 into 1.12.2
[init] Resolving type given FTBA
[init] FTB modpack ID 8, version ID 142 is ready to go
[init] server.properties already created, skipping
[init] Updating ops
[init] Checking for JSON files.
[init] Setting initial memory to 8192M and max to 8192M
[init] Starting the Minecraft server...
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
	at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	... 6 more
2021-04-15T01:18:00.696Z	WARN	mc-server-runner	sub-process failed	{"exitCode": 1}
2021-04-15T01:18:00.697Z	INFO	mc-server-runner	Done

I don't know why its listing that /data permissions error, as the directory has 777 permissions and seems to have populated it just fine. Either way, the server spits out that error and get stuck in CrashLoopBackOff.

Values.yml
# ref: https://hub.docker.com/r/itzg/minecraft-server/
image: itzg/minecraft-server
imageTag: multiarch
strategyType: Recreate

resources:
  requests:
    memory: 8192Mi
    cpu: 500m

livenessProbe: {}
readinessProbe: {}

extraEnv:
  FTB_MODPACK_ID: 8
  FTB_MODPACK_VERSION_ID: 142



minecraftServer:
  eula: "TRUE"
  # One of: LATEST, SNAPSHOT, or a specific version (ie: "1.7.9").
  version: "1.12.2"
  # This can be one of "VANILLA", "FORGE", "SPIGOT", "BUKKIT", "PAPER", "FTB", "SPONGEVANILLA"
  type: "FTBA"
  # One of: peaceful, easy, normal, and hard
  difficulty: normal
  # A comma-separated list of player names to whitelist.
  whitelist:
  # A comma-separated list of player names who should be admins.
  ops: cclloyd
  # A server icon URL for server listings. Auto-scaled and transcoded.
  icon:
  maxPlayers: 10
  maxWorldSize: 10000000
  allowNether: true
  announcePlayerAchievements: true
  enableCommandBlock: true
  forcegameMode: false
  generateStructures: true
  hardcore: false
  maxBuildHeight: 256
  # The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message. -1 disables this entirely.
  maxTickTime: 120000
  spawnAnimals: true
  spawnMonsters: true
  spawnNPCs: true
  # Max view distance (in chunks).
  viewDistance: 18
  # One of: creative, survival, adventure, spectator
  gameMode: survival
  # Message of the Day
  motd: "Sky Odyssey for Casual Try-Hards"
  pvp: true
  # One of: DEFAULT, FLAT, LARGEBIOMES, AMPLIFIED, CUSTOMIZED
  levelType: voidworld
  worldSaveName: world
  # If you adjust this, you may need to adjust resources.requests above to match.
  memory: 8192M
  # General JVM options to be passed to the Minecraft server invocation
  jvmOpts: ""
  # Options like -X that need to proceed general JVM options
  jvmXXOpts: ""

  rcon:
    enabled: false
  query:
    enabled: false

  serviceAnnotations:
    metallb.universe.tf/address-pool: default
  serviceType: LoadBalancer


persistence:
  storageClass: "nfsssd"
  dataDir:
    enabled: true
    Size: 8Gi

AnnotatedConnectException: Connection timed out: no further information

I'm getting the error in the title occasionally when trying to connect to the minecraft server I created using this chart. The server runs fine mostly. The cpu usage is lower than I would expect though, but it runs fine except that people have trouble connecting occasionally.

I am running the deployment on a single node microk8s server that I have port forwarded to a nodeport service. I have 80Mbps internet (though that doesn't seem to matter since I get the error on the same network), and the server has 16 threads with a max frequency of 3.7GHz (though it seems to run around 1.6GHz typically with only 2 mincraft servers on it)

Allow PVC annotations

Please add .Values.persistence.annotations. This is useful for setting helm flags to not delete the PVC when uninstalling.

Library chart

There's a bunch of common items in each of the charts, would make things a little neater if we had a library chart.

Looking for type FTBA support for FTB_MODPACK_ID requirement

Trying to deploy a server using type=ftba so I can run https://feed-the-beast.com/modpack/ftb_presents_direwolf20_1_12 and i'm getting:

chmod: changing permissions of '/data': Operation not permitted [init] Running as uid=1000 gid=1000 with /data as 'drwxrwsr-x 3 0 2000 4096 Jan 12 00:15 /data' [init] Resolved version given 1.12.2 into 1.12.2 [init] Resolving type given FTBA [init] ERROR FTB_MODPACK_ID is required with TYPE=FTB

I tried running it with command line arguments but got the same error. What should I do here?

Specs are a Digital Ocean kubernetes cluster and it just hosts these deployments and here's my server settings in the values file:

  # This must be overridden, since we can't accept this for the user.
  eula: "FALSE"
  # One of: LATEST, SNAPSHOT, or a specific version (ie: "1.7.9").
  version: "1.12.2"
  # This can be one of "VANILLA", "FORGE", "SPIGOT", "BUKKIT", "PAPER", "FTBA", "SPONGEVANILLA"
  type: "FTBA"
  # If type is set to FORGE, this sets the version; this is ignored if forgeInstallerUrl is set
  forgeVersion:
  # If type is set to SPONGEVANILLA, this sets the version
  spongeVersion:
  # If type is set to FORGE, this sets the URL to download the Forge installer
  forgeInstallerUrl:
  # If type is set to BUKKIT, this sets the URL to download the Bukkit package
  bukkitDownloadUrl:
  # If type is set to SPIGOT, this sets the URL to download the Spigot package
  spigotDownloadUrl:
  # If type is set to PAPER, this sets the URL to download the PaperSpigot package
  paperDownloadUrl:
  # If type is set to FTB, this sets the server mod to run. You can also provide the URL to download the FTB package
  ftbServerMod
  # Set to true if running Feed The Beast and get an error like "unable to launch forgemodloader"
  ftbLegacyJavaFixer: false
  # One of: peaceful, easy, normal, and hard
  difficulty: hard
  # A comma-separated list of player names to whitelist.
  whitelist:
  # A comma-separated list of player names who should be admins.
  ops: shazzberry
  # A server icon URL for server listings. Auto-scaled and transcoded.
  icon:
  # Max connected players.
  maxPlayers: 20
  # This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
  maxWorldSize: 10000
  # Allows players to travel to the Nether.
  allowNether: true
  # Allows server to announce when a player gets an achievement.
  announcePlayerAchievements: true
  # Enables command blocks.
  enableCommandBlock: true
  # If true, players will always join in the default gameMode even if they were previously set to something else.
  forcegameMode: false
  # Defines whether structures (such as villages) will be generated.
  generateStructures: true
  # If set to true, players will be set to spectator mode if they die.
  hardcore: false
  # The maximum height in which building is allowed.
  maxBuildHeight: 256
  # The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message. -1 disables this entirely.
  maxTickTime: 60000
  # Determines if animals will be able to spawn.
  spawnAnimals: true
  # Determines if monsters will be spawned.
  spawnMonsters: true
  # Determines if villagers will be spawned.
  spawnNPCs: true
  # Max view distance (in chunks).
  viewDistance: 10
  # Define this if you want a specific map generation seed.
  levelSeed:
  # One of: creative, survival, adventure, spectator
  gameMode: survival
  # Message of the Day
  motd: "Welcome to Minecraft on Kubernetes by Shazzberry!"
  # If true, enable player-vs-player damage.
  pvp: true
  # One of: DEFAULT, FLAT, LARGEBIOMES, AMPLIFIED, CUSTOMIZED
  levelType: BIOMESOP
  # When levelType == FLAT or CUSTOMIZED, this can be used to further customize map generation.
  # ref: https://hub.docker.com/r/itzg/minecraft-server/
  generatorSettings: "https://www.curseforge.com/minecraft/mc-mods/biomes-o-plenty/download/2988999"
  worldSaveName: world
  # If set, this URL will be downloaded at startup and used as a starting point
  downloadWorldUrl:
  # force re-download of server file
  forceReDownload: false
  # If set, the modpack at this URL will be downloaded at startup
  downloadModpackUrl:
  # If true, old versions of downloaded mods will be replaced with new ones from downloadModpackUrl
  removeOldMods: true
  # Check accounts against Minecraft account service.
  onlineMode: true
  # If you adjust this, you may need to adjust resources.requests above to match.
  memory: 4096M
  # General JVM options to be passed to the Minecraft server invocation
  jvmOpts: ""
  # Options like -X that need to proceed general JVM options
  jvmXXOpts: ""
  serviceAnnotations: {}
  serviceType: LoadBalancer
  ## Set the port used if the serviceType is NodePort
  # nodePort:
  loadBalancerIP:
  # loadBalancerSourceRanges: []
  ## Set the externalTrafficPolicy in the Service to either Cluster or Local
  # externalTrafficPolicy: Cluster
  externalIPs:`

Import data feature

Hello, thanks for this project.

Quick question: How can I import a backup done with itzg/mc-backup ?
I guess one answer would be to fill a PVC, then use it as an existing claim.

I'd like to be able to define an initContainer in your charts so that we can use itzg/mc-backup image to GET a backup from wherever, then fill a shared PVC with the main container so that it would start with an eixsting world.

Would that be an interesting feature for your charts ?

I'm thinking about adding an inline initContainer like so: https://github.com/bitnami/charts/blob/master/bitnami/postgresql/templates/statefulset.yaml#L132-L134
&
https://github.com/bitnami/charts/blob/master/bitnami/postgresql/values.yaml#L483-L488

What do you think ?

gamemode creative does not take effects

in the latest chart v 3.8.0 that uses latest image Image: itzg/minecraft-server:latest, I can see MODE: CREATIVE but it doesn't take effect. When i connect to the world it is survival.

Any idea?

How do you obtain an external IP address after installing?

Sorry I tried following the instructions of:

Get the IP address of your Minecraft server by running these commands in the
same shell:
  export POD_NAME=$(kubectl get pods \
    --namespace minecraft \
    -l "component=minecraft-minecraft" \
    -o jsonpath="{.items[0].metadata.name}")
  kubectl port-forward $POD_NAME 25565:25565
  echo "Point your Minecraft client at 127.0.0.1:22565"

when trying to do the first command I get an error:

error: error executing jsonpath "{.items[0].metadata.name}": Error executing template: array index out of bounds: index 0, length 0. Printing more information for debugging the template:
        template was:
                {.items[0].metadata.name}
        object given to jsonpath engine was:
                map[string]interface {}{"apiVersion":"v1", "items":[]interface {}{}, "kind":"List", "metadata":map[string]interface {}{"resourceVersion":"", "selfLink":""}}

Sorry I am new to kubernetes and Bash, but for the "export POD_NAME" do we replace the POD_NAME with the pod name from:

kubectl get pods -n minecraft

minecraft-minecraft-668c498d5b-59n6d

I tried replacing the POD Name from what I got from the namespace, but got:
bash: export: minecraft-minecraft-668c498d5b-59n6d=': not a valid identifier`

I am executing helm from my computer and not on the kubernetes master. The cluster is a raspberry pi cluster

minecraft.svc misses annotation

as per the title, minecraft.svc misses a piece, that is contained in the other services

   annotations:
     {{ toYaml .Values.minecraftServer.serviceAnnotations | indent 4 }}

Backup container fails to start

When using mcbackup, the backup container fails to start with:

level=fatal msg="Failed to run sub-command" error="fork/exec /usr/bin/backup: operation not permitted".

My Helm values:

mcbackup:
  enabled: true
  persistence:
    annotations:
      nfs.io/storage-path: minecraft-backups
    storageClass: deimos-nfs

    backupDir:
      enabled: true
      Size: 5Gi

I checked and I have the following permissions set for the backups directory:
drwxrwxrwx 1 1000 2000 6 Jan 12 05:55 backups

I have not been able to get the backup container to run unless I make the runAsUser root:

securityContext:
    runAsUser: 0

Is there perhaps another way? Or should the Helm chart allow us to set the run as user as root?

I assume the issue is in entrypoint-demoter that tries to change the user which runs the backup command.

setCredentials(uid, gid, command)

Consider using ingress

In the use case where we want to expose the server to the public, I think Kubernetes Ingress would be better than exposing the service as NodePort, for domain name, pathes etc .. ?

Change persistence.dataDir.storageClass to persistence.dataDir.storageClassName

The documentation in the values.yaml under persistence use the boilerplate text

persistence:
annotations: {}
## minecraft data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
dataDir:
# Set this to false if you don't care to persist state between restarts.
enabled: false
# existingClaim: nil
Size: 1Gi

Which indicates that to use a storageClass you should use storageClassName. This is inline with many other charts and the value in a PVC definition. However the template uses storageClass instead of storageClassName. I didn't find this until I looked at the template itself and the deployment used a local-path instead of my specified storageclass

{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"

Either the documentation in README.md and the values.yaml should be updated, or better the general standard should be followed and use storageClassName

Feature Request(/Contribution Offer): Scripts to support easy use of this chart

Thanks so much, this is a really useful project, It has transformed the ease of management of (java) Minecraft servers for me.

However, quite a bit of background in K8S and Helm is required to take advantage of it. I propose that a the project provides a script for a simple CLI for deploying and managing servers.

I have a fully functional project which I'm happy to contribute here if you think appropriate. See the last section of the README for details of my CLI script. (I also include simple instructions for getting a cluster up and running at home)

https://github.com/gilesknap/k3s-minecraft

Add Bluemap support like Dynmap

Bluemap is like Dynmap and is a new project that seems to be much lighter on the resources. I've been using it for local testing and it's been great. Would a PR be welcomed in the coming weeks to get this added to the chart in the way DynMap is?

Error setting extraEnv variables

I'm trying to set some env variables to use with the multiarch image of minecraft, but helm is spitting an error when trying to deploy.

extraEnv:
  FTB_MODPACK_ID: "35"

Gives me the error

v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects " or n, but found 3, error found in #10 byte of ...|,"value":35}],"image|..., bigger context ...|TS","value":""},{"name":"FT
B_MODPACK_ID","value":35}],"image":"itzg/minecraft-server:multiarch","ima|...

Helm version: version.BuildInfo{Version:"v3.2.3", GitCommit:"8f832046e258e2cb800894579b1b3b50c2d83492", GitTreeState:"clean", GoVersion:"go1.13.12"}
Chart version: 2.0.2
App version: 1.14.4

rclone config should be provided as a Secret

An rclone config file contains data that should be kept secret, such as API keys for storage backends. Currently, the supported way to set the rclone config file contents is to put these contents into the values for a release. The contents will then be stored in a ConfigMap, which is not a secure place to put secrets.

It's currently possible to override this behaviour with a safer approach, if you set up the volume mounts using extraVolumes and create the secret manually. Here's what I'm using:

    extraVolumes:
      - volumeMounts:
        - name: real-rclone-config
          mountPath: /config/rclone
        volumes
        - name: real-rclone-config
          secret:
            secretName: my-rclone-config-secret

However, it's probably not a good idea for the chart/documentation to be encouraging users to use an unsafe configuration. The ConfigMap-based approach should be deprecated or transparently replaced with a Secret-based approach. This chart should also allow users to specify an existing secret, similarly to how the RCON password is handled; this is especially useful for GitOps-style workflows (e.g. Flux) where secrets have to be created separately from Helm release inputs.

Extra port definitions

I'm trying to get dynmap to come through with this chart and I'm trying to figure out which way it should be handled. I can see a specific dynmap: true flag that does the things or something more generic like extraPorts that pastes anything inside into the deployment and service yaml. I can see value in the former because it is easy for people to add dynmap then and the latter because it's easier to select what ports you may need and how to expose them.

Thoughts?

rcon error

Change values to:
rcon:
enabled: TRUE

and try deploying. Kubernetes throws this error

Error: UPGRADE FAILED: YAML parse error on minecraft/templates/rcon-svc.yaml: error converting YAML to JSON: yaml: line 6: did not find expected key

Invalid or corrupt jarfile minecraft_server.1.19.2.jar

what i do

helm upgrade --install minecraft charts/minecraft --namespace minecraft --create-namespace --set minecraftServer.eula=true,persistence.dataDir.enabled=true,minecraftServer.serviceType=NodePort

what happend

$ kubectl -n minecraft get pods 
NAME                                   READY   STATUS             RESTARTS      AGE
minecraft-minecraft-79bc8f8d79-tjmcg   0/1     CrashLoopBackOff   5 (20s ago)   5m20s

the error logs

$ kubectl -n minecraft logs -f minecraft-minecraft-79bc8f8d79-tjmcg
chmod: changing permissions of '/data': Operation not permitted
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwsrwx 1 0 2000 104 Aug  7 15:38 /data'
[init] Resolved version given LATEST into 1.19.2 and major version 1.19
[init] Resolving type given VANILLA
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 1024M and max to 1024M
[init] Starting the Minecraft server...
Error: Invalid or corrupt jarfile minecraft_server.1.19.2.jar
2022-08-07T15:39:24.684Z        WARN    mc-server-runner        Minecraft server process failed {"exitCode": 1}
2022-08-07T15:39:24.684Z        INFO    mc-server-runner        Done

`pruneBackupsDays` not honoured

The minecraft chart accepts a parameter mcbackup.pruneBackupsDays. However, as can be seen from this code search, it doesn't actually map that to the PRUNE_BACKUPS_DAYS env var for the mc-backup container.

As a workaround, users can pass the env var manually:

spec:
  values:
    extraEnv:
      PRUNE_BACKUPS_DAYS: "0"  # disable backup pruning

OPS or WHITELIST doesn't work in offline mode

Im working with java version
I installed the server with the helm chart, added player usernames to the ops and whitelist fields, like this:
whitelist: User1,User2,User3,User4,klucsik
ops: User1,User2,User3,User4,klucsik
overrideServerProperties: true

The server is freshly installed, its in offline mode, but I got rejected with the klucsik username.
[15:09:13] [Server thread/INFO]: Disconnecting com.mojang.authlib.GameProfile@6b639c5c[id=09cfa1dc-dd17-3c85-bb06-5e391a0f199e,name=klucsik,properties={},legacy=false] (/192.168.100.201:38299): You are not white-listed on this server!

Is it possible to use whitelist/ops in offline mode?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.