dontstarvetogether

by utkuozdemir

Helm chartv1.0.3App vanillaVerified publisher

A Helm chart for the game Don't Starve Together based on the image https://github.com/Jamesits/docker-dst-server

About this chart

dontstarvetogether

Don't Starve Together is the standalone multiplayer expansion of the uncompromising wilderness survival game, Don't Starve.

TL;DR

$ helm repo add utkuozdemir https://utkuozdemir.org/helm-charts
$ helm install my-release utkuozdemir/dontstarvetogether

Introduction

This chart starts a dedicated server of Don't Starve together, running the Docker image Jamesits/docker-dst-server

Prerequisites

  • Kubernetes 1.15+
  • Helm 3.0+
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

$ helm repo add utkuozdemir https://utkuozdemir.org/helm-charts
$ helm install my-release utkuozdemir/dontstarvetogether

These commands deploy one DST dedicated server in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release release:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Parameters

KeyDescriptionDefault
persistence.enabledUse persistent volume to store datatrue
persistence.storageClassType of persistent volume claimnil
persistence.accessModesPersistence access modes["ReadWriteOnce"]
persistence.sizeSize of persistent volume claim"1Gi"
useHostPortsIf the server should use hostPort directives for external accessfalse
terminationGracePeriodSecondsDuration in seconds the pod needs to terminate gracefully120
podSecurityPolicy.createIf a PodSecurityPolicy should be created with its required Role and RoleBindingsfalse
image.repositoryImage repository"docker.io/jamesits/dst-server"
image.pullPolicyImage pull policy"IfNotPresent"
image.tagImage tag (if not speficied, defaults to the chart's appVersion)""
initImage.repositoryInit container image repository"docker.io/busybox"
initImage.pullPolicyInit container image pull policy"IfNotPresent"
initImage.tagInit container image tag"musl"
imagePullSecretsImage pull secrets[]
nameOverrideString to partially override dontstarvetogether.fullname template with a string (will prepend the release name)""
fullnameOverrideString to fully override dontstarvetogether.fullname template with a string""
serviceAccount.createCreate a service account. If podSecurityPolicy.create is true, a service account will be created regardless of this flagtrue
serviceAccount.annotationsAnnotations for the service account{}
serviceAccount.nameThe name of the service account to create""
podAnnotationsAnnotations for the pod{}
podSecurityContextSecurity context for the pod{}
securityContextSecurity context for the container{}
service.typeType of the service"ClusterIP"
service.annotationsAnnotations for the service{}
resourcesThe resource requests and limits of the container{}
nodeSelectorThe node selector{}
tolerationsTolerations for the pod assignment[]
affinityAffinity for the pod assignment{}
config.root.clusterTokenThe required cluster token for the DST servernil
config.root.network.cluster_nameThe name of the DST server"My Server"
config.root.network.cluster_descriptionThe description of the DST server"My Server"
config.root.network.cluster_passwordThe password for the DST servernil
config.root.network.offline_clusterWhether the DST server should be an offline serverfalse
config.root.network.lan_only_clusterWhether the DST server should be LAN onlyfalse
config.root.network.cluster_intentionThe intention of the DST server"cooperative"
config.root.network.autosaver_enabledWhether the autosaver should be enabled on the DST servertrue
config.root.network.tick_rateThe DST server tick rate30
config.root.gameplay.game_modeThe DST server game mode"survival"
config.root.gameplay.max_playersMax players for the DST server10
config.root.gameplay.pvpWhether the DST server is PVP-enabled or notfalse
config.root.gameplay.pause_when_emptyPause DST server when emptytrue
config.root.steam.steam_group_onlySteam group-only DST serverfalse
config.root.steam.steam_group_idSteam group id for the group-only DST server0
config.root.steam.steam_group_adminsSteam group admins for the group-only DST serverfalse
config.root.misc.console_enabledWhether the console is enabled on the DST servertrue
config.root.misc.max_snapshotsMax snapshots to be stored on the DST server6
config.root.shard.shard_enabledWhether the shard should be enabled for DST server or nottrue
config.root.shard.bind_ipDST server bind IP"127.0.0.1"
config.root.shard.master_ipDST server master IP"127.0.0.1"
config.root.shard.master_portDST server internal communication port10998
config.root.shard.cluster_keyDST server cluster key"MySecretKey"
config.root.additionalFiles."adminlist.txt"The list of admins on the DST server""
config.root.additionalFiles."blocklist.txt"The DST server block list""
config.root.additionalFiles."whitelist.txt"The DST server white list""
config.master.network.server_portThe DST server master port10999
config.master.shard.is_masterBoilerplatetrue
config.master.account.encode_user_pathBoilerplatetrue
config.master.steam.master_server_portSteam communication port for master12346
config.master.steam.authentication_portSteam authentication port for master8766
config.master.additionalFilesAdditional files for the master configuration{}
config.caves.network.server_portThe DST server caves port11000
config.caves.shard.is_masterBoilerplatefalse
config.caves.shard.nameBoilerplate"Caves"
config.caves.account.encode_user_pathBoilerplatetrue
config.caves.steam.master_server_portSteam communication port for caves12347
config.caves.steam.authentication_portSteam authentication port for caves8767
config.caves.additionalFilesAdditional files for the caves configuration{}
config.mods.additionalFiles."dedicated_server_mods_setup.lua"Mod installation configuration (by default, mod installations are commented out)"-- [API] Gem Core (mod dependency) - https://steamcommunity.com/sharedfiles/filedetails/?id=1378549454\n--ServerModSetup(\"1378549454\")\n-- Health Info https://steamcommunity.com/sharedfiles/filedetails/?id=375859599\n--ServerModSetup(\"375859599\")\n-- Global Positions https://steamcommunity.com/sharedfiles/filedetails/?id=378160973\n--ServerModSetup(\"378160973\")\n-- Food Values - Item Tooltips https://steamcommunity.com/sharedfiles/filedetails/?id=458940297\n--ServerModSetup(\"458940297\")\n-- Global Pause https://steamcommunity.com/sharedfiles/filedetails/?id=758532836\n--ServerModSetup(\"758532836\")\n"

The above config parameters map to the various config files and flags of a typical DST dedicated server.

For more information please refer to the Don’t Starve Together Dedicated Server Guide and to the Jamesits/docker-dst-server image configuration.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install my-release \
    --set config.root.network.cluster_name=My Server \
    --set config.root.network.cluster_description=My Description \
    --set config.root.network.cluster_password=MySecretPassword \
    utkuozdemir/dontstarvetogether

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

helm install my-release -f values.yaml utkuozdemir/dontstarvetogether

Tip: You can use the default values.yaml

Configuration

There are a few configuration parameters that need your attention. Those are:

  • useHostPorts or service.type: For your server to be accessible, you would either want to set useHostPorts: true or service.type: LoadBalancer, but not both.

    If you are running a single-node cluster, you can simply use hostPorts. If your cluster supports external load balancing, you can use service.type: LoadBalancer and use the external IP of the service.

  • config.root.clusterToken: Every DST server requires a cluster token - therefore this is a required parameter.

    There are different ways to generate a server token. It looks like pds-g^KU_aiBJDSpM^i7eXaSfdsDdfgvvftDfs42bfZG0TWER0APv3Hjo=.

    See This page for more information.

  • config.root.network.cluster_name: Give your server a friendly name - so you can find it easily in the "Browse Servers" listings.

  • config.root.network.cluster_description: Give your server a friendly description.

  • config.root.network.cluster_password: Protect your server with a strong password.

  • The four ports: config.master.network.server_port, config.master.steam.master_server_port, config.caves.network.server_port and config.master.steam.master_server_port: If you want to run a single server on a cluster node, you can leave them as-is. However, if you want to run multiple DST servers on the same node using hostPorts, you will need to use 4 different ports for the second server. See the 2 sample configurations to serve as an example.

  • resources.requests: I recommend allocating some CPU and memory for your dedicated server for a more reliable experience.

  • config block: The whole config block maps to the typical DST dedicated server configuration. So, anything you want to customize - you can do it in this block. As an example, see the "complex" sample values file.

Lastly, see the sample values files for a minimal configuration, and for a more complex configuration that enables mods, overrides the ports etc.

Deploy dontstarvetogether with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has dontstarvetogether on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdontstarvetogether is pinned at v1.0.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply