ark-cluster
by SickHub
A Helm chart for an Ark - Survival Evolved cluster
About this chart
ark-cluster : an ARK Survival Evolved cluster Helm Chart
ARK Survival Evolved is sandbox survival game available for example on Steam: https://store.steampowered.com/app/346110/ARK_Survival_Evolved/
How It Works
The chart is based on the docker image https://github.com/SickHub/arkserver (previously https://github.com/drpsychick/arkserver forked from https://github.com/thmhoag/arkserver)
which uses arkmanager (https://github.com/arkmanager/ark-server-tools)
to install and update ARK from steam as well as mods.
It creates a deployment for each server defined in your values.yaml, with replicas: 0 by default.
All servers will share the ShooterGame server files and clusters directory, once you have persistence configured.
Requirements for Kubernetes
- ARK communicates its port to the client, thus the external port must be identical to the port where the ARK pod is listening.
- Persistent volumes:
- one volume for the shared server (game) files (the biggest volume) to save space (mounted as
/arkserver) - one volume for each server (mounted as
/arkserver/ShooterGame/Saved) - one volume for the shared cluster files (mounted as
/arkserver/ShooterGame/Saved/clusters)
- one volume for the shared server (game) files (the biggest volume) to save space (mounted as
Deploy ark-cluster
Only configure ONE server to do updateOnStart, all other servers will wait for the server and mods to be up to date
before starting the server. The server doing the updates should thus be the one with ALL mods configured you want to use.
You must configure persistence, if you want your data to be persisted (Game, Saved, ... everything).
helm repo add ark https://sickhub.github.io/ark-server-charts
helm repo update
helm search repo ark
helm upgrade --create-namespace --namespace ark --install --values values.yaml arkcluster ark/ark-cluster
Start the first server with the following setting:
servers:
extinction:
updateOnStart: true
This will download and install ark server and modules.
Clustering
Minimal definition of a server:
servers:
extinction:
map: Extinction
If you only have 1 public IP address available, you must set ports for each server:
servers:
extinction:
ports:
queryudp: 27015
gameudp: 7770
rcon: 32330
Custom .ini files
Can be configured globally on top level as well as per server. A change in config will then result in a restart of the server.
You can access attributes of your servers entry with .server.attributeName, see XPMultiplier:
servers:
extinction:
customConfigMap:
GameIni: |
[/Script/ShooterGame.ShooterGameMode]
bDisableStructurePlacementCollision=True
PerLevelStatsMultiplier_Player[0]=2.0
PerLevelStatsMultiplier_Player[4]=2.0
PerLevelStatsMultiplier_Player[5]=2.0
PerLevelStatsMultiplier_Player[7]=2.0
PerLevelStatsMultiplier_DinoTamed[7]=2.0
PerLevelStatsMultiplier_DinoWild[7]=1
MatingIntervalMultiplier=0.1
BabyMatureSpeedMultiplier=25.0
EggHatchSpeedMultiplier=15.0
BabyCuddleIntervalMultiplier=0.1
GameUserSettingsIni: |
[/Script/ShooterGame.ShooterGameUserSettings]
Version=5
[ServerSettings]
AllowFlyerCarryPvE=True
AllowThirdPersonPlayer=True
AlwaysNotifyPlayerLeft=False
AutoSavePeriodMinutes=15.000000
ClampResourceHarvestDamage=False
XPMultiplier={{ .server.xpMultiplier }}
[...]
Persistence
Ways of configuring persistence. If you don't configure persistence, the game will be downloaded in emptyDir and all
changes lost when the pod is deleted.
- provide a
PersistentVolumefor game, cluster and each server - provide an
existingClaimfor game, cluster and each server
1. Provide PersistentVolume
When you enable persistence, the chart will create the PersistentVolumeClaims for you. It then expects to bind these claims
with volumes of the same name: <cluster-name>-game, <cluster-name>-cluster and <cluster-name>-<server-name>
persistence:
enabled: true
Alternatively you can point to existing volumes with existingVolume:
persistence:
enabled: true
game:
existingVolume: ark-game
cluster:
existingVolume: ark-cluster
save:
# server name will be appended, e.g. `ark-extinction`
existingVolume: ark
2. Provide existingClaim
You can simply provide existing PersistentVolumeClaimss for each volume:
persistence:
enabled: true
game:
existingClaim: ark-game
cluster:
existingClaim: ark-cluster
save:
# server name will be appended, e.g. `ark-extinction`
existingClaim: ark
Shared Server Files
Server files are shared across multiple ARK instances of the cluster
extraEnvVars:
- name: am_arkStagingDir
value:
- name: ARKSERVER_SHARED
value: /arkserver
Limit resources
Optionally create a quota for your namespace, see https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/
Example:
apiVersion: v1
kind: ResourceQuota
metadata:
name: arkcluster-quota
spec:
hard:
requests.cpu: "3"
requests.memory: 18Gi
# limit to max 3 running servers
limits.cpu: "4.5"
limits.memory: 24Gi
Contributing
- Create issues, create PRs, ... let's make this better together.
- See Contributing
Credits
Inspired by
Deploy ark-cluster with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ark-cluster 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartark-cluster is pinned at v0.2.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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