Skip to content

Commit

Permalink
Merge pull request #44 from Lyr-7D1h/added_tolerations
Browse files Browse the repository at this point in the history
Added icon & tolerations
  • Loading branch information
Addyvan authored Jan 3, 2022
2 parents b55eec4 + 5ebb156 commit 9ab6ce0
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 33 deletions.
67 changes: 36 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kubernetes deployment for a valheim game-server. Based off the dockerization wor

## Usage

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

```bash
helm repo add valheim-k8s https://addyvan.github.io/valheim-k8s/
Expand All @@ -19,26 +19,27 @@ helm install valheim-server valheim-k8s/valheim-k8s \

## 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` | | `{}` |
| `image.repository` | Specifies container image repository | `lloesche/valheim-server` |
| `image.tag` | Specifies container image tag | `latest` |
| 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` |

## Persistence

Expand All @@ -51,6 +52,7 @@ You can enable persistence for both the server data (your worlds, mounted at `/c
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:

```bash
$ ls /data/valheim
adminlist.txt backups bannedlist.txt permittedlist.txt prefs worlds
Expand All @@ -64,26 +66,29 @@ Once you have your StorageClass set up, set `storage.kind` to `persistentVolumeC

### 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:
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:

```bash
$ 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
* set the port to 2457 ([reason for that here](https://github.com/lloesche/valheim-server-docker/discussions/32#discussioncomment-371306))
* 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
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
- set the port to 2457 ([reason for that here](https://github.com/lloesche/valheim-server-docker/discussions/32#discussioncomment-371306))
- 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](https://github.com/mbround18/valheim-docker/discussions/51)

## 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

- 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
3 changes: 2 additions & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v2
name: valheim-k8s
description: Basic chart for deploying valheim to a k8s homelab
icon: https://www.google.com/url?sa=i&url=https%3A%2F%2Fstore.steampowered.com%2Fapp%2F892970%2FValheim%2F&psig=AOvVaw1MMOQJzse-eyruGtGG0DEs&ust=1641045420126000&source=images&cd=vfe&ved=0CAsQjRxqFwoTCIDmhd2YjvUCFQAAAAAdAAAAABAJ
type: application
version: 0.2.0
appVersion: 1.16.0
appVersion: 1.16.0
4 changes: 4 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
name: valheim-server
Expand Down
3 changes: 3 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ networking:


nodeSelector: {}

tolerations: {}


# resources:
# requests:
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5

0 comments on commit 9ab6ce0

Please sign in to comment.