All Projects → Addyvan → valheim-k8s

Addyvan / valheim-k8s

Licence: MIT license
valheim game-server on kubernetes

Projects that are alternatives of or similar to valheim-k8s

Steam-Server-Manager
PowerShell Steam Server Manager
Stars: ✭ 33 (-55.41%)
Mutual labels:  dedicated-server, game-server
gokube
gokube is a tool that makes it easy developing day-to-day with Kubernetes on your laptop.
Stars: ✭ 22 (-70.27%)
Mutual labels:  helm
helm-chart
Makes develping the chart boilerplate easier.
Stars: ✭ 31 (-58.11%)
Mutual labels:  helm
flux-ui
web ui for fluxctl (gitops tool)
Stars: ✭ 30 (-59.46%)
Mutual labels:  helm
eXpansion
eXpand your Manialive server controller to the new hights
Stars: ✭ 19 (-74.32%)
Mutual labels:  dedicated-server
kubewise
Get Helm notifications in your team chat
Stars: ✭ 52 (-29.73%)
Mutual labels:  helm
jenkins-stack-docker
Docker-compose version of jenkins-stack-kubernetes
Stars: ✭ 135 (+82.43%)
Mutual labels:  helm
ARK
ARK is a lightweight, agile, elastic, distributed plugin framework written in C++,make it easier and faster to create your own application service.
Stars: ✭ 411 (+455.41%)
Mutual labels:  game-server
workshopctl
A tool to run workshops with
Stars: ✭ 38 (-48.65%)
Mutual labels:  helm
helm-clientgo-example
helm client-go example to add helm repo, fetch charts and install chart
Stars: ✭ 27 (-63.51%)
Mutual labels:  helm
helm-pgadmin
Helm Chart for pgAdmin
Stars: ✭ 17 (-77.03%)
Mutual labels:  helm
zeebe-helm
Public Zeebe K8s HELM Charts
Stars: ✭ 13 (-82.43%)
Mutual labels:  helm
gotway
☸️ Cloud native API Gateway powered with in-redis cache
Stars: ✭ 71 (-4.05%)
Mutual labels:  helm
draughtsman
An in-cluster agent that handles Helm based deployments
Stars: ✭ 31 (-58.11%)
Mutual labels:  helm
topaz
💎 A server emulator for Final Fantasy XI.
Stars: ✭ 46 (-37.84%)
Mutual labels:  game-server
helm-charts
Helm charts for sigstore project
Stars: ✭ 33 (-55.41%)
Mutual labels:  helm
kubernetes-logging-helm
Scalable Kubernetes logging stack with Opensearch
Stars: ✭ 42 (-43.24%)
Mutual labels:  helm
croc-hunter-jenkinsx
Croc Hunter demo, deployed with Jenkins X
Stars: ✭ 19 (-74.32%)
Mutual labels:  helm
rules helm
rules_helm: Bazel rules for managing helm charts
Stars: ✭ 46 (-37.84%)
Mutual labels:  helm
mmo-arch
Base Architecture for creating scalable games using microservices through Angular, Phaser, NestJS, NATS, and MySQL
Stars: ✭ 25 (-66.22%)
Mutual labels:  game-server

valheim-k8s

kubernetes deployment for a valheim game-server. Based off the dockerization work by lloesche here.

Usage

Note: This assumes the node you are running on can use /data/valheim mounted as a host volume for persistence.

helm repo add valheim-k8s https://addyvan.github.io/valheim-k8s/
helm repo update
helm install valheim-server valheim-k8s/valheim-k8s  \
  --set worldName=example-world-name \
  --set serverName=example-server-name \
  --set password=password \
  --set storage.kind=hostvol \
  --set storage.hostvol.path=/data/valheim

Configuration

Parameter Description Default
worldName Prefix of the world files to use (will make new if missing) example-world-name
serverName Server name displayed in the server browser(s) example-server-name
password Server password password
storage.kind Storage strategy/soln used to provide the game-server with persistence hostvol
storage.hostvol.path The folder to be mounted into /config in the game-server pod /data/valheim
storage.pvc.storageClassName The storageClass used to create the persistentVolumeClaim default
storage.pvc.size The size of the persistent volume to be created 1Gi
serverStorage.kind Storage strategy/soln used to save the server installation files hostvol
serverStorage.hostvol.path The folder to be mounted into /opt/valheim in the game-server pod /data/valheim-server
serverStorage.pvc.storageClassName The storageClass used to create the persistentVolumeClaim default
serverStorage.pvc.size The size of the persistent volume to be created 5Gi
networking.serviceType The type of service e.g NodePort, LoadBalancer or ClusterIP LoadBalancer
networking.gamePort The UDP start port the server will listen on 2456
networking.nodePort When service type is NodePort, assign a fixed UDP port to the server ""
networking.publishQueryPort Expose the Steam query port (gamePort + 1) true
nodeSelector {}
tolerations []
image.repository Specifies container image repository lloesche/valheim-server
image.tag Specifies container image tag latest
priorityClassName Specifies the priority class name for the deployment None

Persistence

Currently persistence is supported through mounting a hostvol or via a persistentVolumeClaim. Please create an issue if you would like support for specific cloud storage solutions via PVCs / storageclasses. They vary by provider so PRs / testers welcome for this.

You can enable persistence for both the server data (your worlds, mounted at /config and configured with the storage parameter) and the server installation (to skip downloading it every time a pod is created, mounted at /opt/valheim, configured with the serverStorage parameter).

Using a Host Volume

Note: If you are deploying to a cloud provider it is highly recommended that you use a PVC powered by a cloud-specific storageClass. Otherwise you risk losing your world.

On the node you wish to use make sure the folder you are mounting exists (ideally empty if you are starting a new world). Once you spin up the game pod you should see the following files created:

$ ls /data/valheim
adminlist.txt  backups  bannedlist.txt  permittedlist.txt  prefs  worlds

Using a persistentVolumeClaim

To use a persistentVolumeClaim for storage, you will need to first set up your CSI and StorageClass for your K8s cluster. Information regarding that differs by cloud provider and there are several guides available for configuring each of them.

Once you have your StorageClass set up, set storage.kind to persistentVolumeClaim, optionally set storage.pvc.storageClassName to the name of your previously configured StorageClass (or it will use the default StorageClass), and set storage.pvc.size to the size of the volume to create (default 1Gi).

Using an existing world

To use an existing world simply set the worldName parameter to the name of your world then save the .db and .fwl files to the directory mounted into the pod. For example, if your world is named myworld then set worldName: myworld in your values file (or --set worldName=myworld) and assuming you are mounting at /data/valheim then your directory should look like:

$ ls /data/valheim/worlds/
myworld.db  myworld.fwl

Connecting to your world

Assuming you have taken care of the networking (port-forwarding if needed, LoadBalancer IP is created, ...):

  • In the steam UI (NOT IN GAME) go to view->servers->add favorite
  • To connect double click the server in the steam servers explorer
    • You will be asked for the password in the steam ui and in game

More visual set of instructions here

Potential future updates

If there is interest I can hash out the following:

  • Cronjob to save backups to s3, blob storage, or minio
    • Then clear up the space in the hostvol/pvc
  • More persistence options, namely for those looking to run this on the cloud
    • I'm familiar with Azure and AWS but I'm sure GCP and others will be fairly simple to figure out if we have testers
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].