{"id":13821226,"url":"https://github.com/Addyvan/valheim-k8s","last_synced_at":"2025-05-16T12:33:00.438Z","repository":{"id":42813398,"uuid":"339116880","full_name":"Addyvan/valheim-k8s","owner":"Addyvan","description":"valheim game-server on kubernetes","archived":false,"fork":false,"pushed_at":"2024-09-30T22:33:21.000Z","size":77,"stargazers_count":94,"open_issues_count":2,"forks_count":46,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-19T21:35:59.412Z","etag":null,"topics":["dedicated-server","game-server","helm","kubernetes","valheim"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Addyvan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-02-15T15:15:23.000Z","updated_at":"2024-10-21T12:06:06.000Z","dependencies_parsed_at":"2024-01-13T16:25:35.981Z","dependency_job_id":"94647a53-256f-4351-848a-7ae6ab952c2e","html_url":"https://github.com/Addyvan/valheim-k8s","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addyvan%2Fvalheim-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addyvan%2Fvalheim-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addyvan%2Fvalheim-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addyvan%2Fvalheim-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addyvan","download_url":"https://codeload.github.com/Addyvan/valheim-k8s/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254530639,"owners_count":22086651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dedicated-server","game-server","helm","kubernetes","valheim"],"created_at":"2024-08-04T08:01:17.950Z","updated_at":"2025-05-16T12:32:55.427Z","avatar_url":"https://github.com/Addyvan.png","language":null,"funding_links":[],"categories":["kubernetes"],"sub_categories":[],"readme":"# valheim-k8s\n\nKubernetes deployment for a valheim game-server. Based off the dockerization work by lloesche [here](https://github.com/lloesche/valheim-server-docker).\n\nFor advanced configuration options see [valheim-server-docker repo's README](https://github.com/lloesche/valheim-server-docker)\n\n## Usage\n\nNote: This assumes the node you are running on can use `/data/valheim` mounted as a host volume for persistence.\n\n```bash\nhelm repo add valheim-k8s https://addyvan.github.io/valheim-k8s/\nhelm repo update\nhelm install valheim-server valheim-k8s/valheim-k8s  \\\n  --set worldName=example-world-name \\\n  --set serverName=example-server-name \\\n  --set password=password \\\n  --set storage.kind=hostvol \\\n  --set storage.hostvol.path=/data/valheim\n```\n\n## Configuration\n\n| Parameter                            | Description                                                            | Default                   |\n|:-------------------------------------|:-----------------------------------------------------------------------|:--------------------------|\n| `worldName`                          | Prefix of the world files to use (will make new if missing)            | `example-world-name`      |\n| `serverName`                         | Server name displayed in the server browser(s)                         | `example-server-name`     |\n| `password`                           | Server password                                                        | `password`                |\n| `passwordSecret`                     | Name of Kubernetes secret to pull secret from. Secret should contain a single field labeled `password`                                                        | None                |\n| `storage.kind`                       | Storage strategy/soln used to provide the game-server with persistence | `hostvol`                 |\n| `storage.hostvol.path`               | The folder to be mounted into /config in the game-server pod           | `/data/valheim`           |\n| `storage.pvc.storageClassName`       | The storageClass used to create the persistentVolumeClaim              | `default`                 |\n| `storage.pvc.size`                   | The size of the persistent volume to be created                        | `1Gi`                     |\n| `serverStorage.kind`                 | Storage strategy/soln used to save the server installation files       | `hostvol`                 |\n| `serverStorage.hostvol.path`         | The folder to be mounted into /opt/valheim in the game-server pod      | `/data/valheim-server`    |\n| `serverStorage.pvc.storageClassName` | The storageClass used to create the persistentVolumeClaim              | `default`                 |\n| `serverStorage.pvc.size`             | The size of the persistent volume to be created                        | `5Gi`                     |\n| `useHostNetworking`                  | If true, set pod.spec.hostNetwork = true and don't create a service    | `false`                   |\n| `networking.serviceType`             | The type of service e.g `NodePort`, `LoadBalancer` or `ClusterIP`      | `LoadBalancer`            |\n| `networking.loadBalancerIP`          | A user supplied IP for service type LoadBalancer                       | None                      |\n| `networking.gamePort`                | The UDP start port the server will listen on                           | `2456`                    |\n| `networking.nodePort`                | When service type is `NodePort`, assign a fixed UDP port to the server | `\"\"`                      |\n| `networking.publishQueryPort`        | Expose the Steam query port (gamePort + 1)                             | `true`                    |\n| `nodeSelector`                       |                                                                        | `{}`                      |\n| `tolerations`                        |                                                                        | `[]`                      |\n| `image.repository`                   | Specifies container image repository                                   | `lloesche/valheim-server` |\n| `image.tag`                          | Specifies container image tag                                          | `latest`                  |\n| `priorityClassName`                  | Specifies the priority class name for the deployment                   | None                      |\n\n## Persistence\n\nCurrently 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.\n\nYou 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).\n\n### Using a Host Volume\n\nNote: 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.\n\nOn 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:\n\n```bash\n$ ls /data/valheim\nadminlist.txt  backups  bannedlist.txt  permittedlist.txt  prefs  worlds\n```\n\n### Using a persistentVolumeClaim\n\nTo 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.\n\nOnce 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).\n\n### Using an existing world\n\nTo 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:\n\n```bash\n$ ls /data/valheim/worlds/\nmyworld.db  myworld.fwl\n```\n\n## Connecting to your world\n\nAssuming you have taken care of the networking (port-forwarding if needed, LoadBalancer IP is created, ...):\n\n- In the steam UI (NOT IN GAME) go to view-\u003eservers-\u003eadd favorite\n  - set the port to 2457 ([reason for that here](https://github.com/lloesche/valheim-server-docker/discussions/32#discussioncomment-371306))\n- To connect double click the server in the steam servers explorer\n  - You will be asked for the password in the steam ui and in game\n\nMore visual set of instructions [here](https://github.com/mbround18/valheim-docker/discussions/51)\n\n## Potential future updates\n\nIf there is interest I can hash out the following:\n\n- Cronjob to save backups to s3, blob storage, or minio\n  - Then clear up the space in the hostvol/pvc\n- More persistence options, namely for those looking to run this on the cloud\n  - 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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAddyvan%2Fvalheim-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAddyvan%2Fvalheim-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAddyvan%2Fvalheim-k8s/lists"}