Skip to content

Commit

Permalink
Merge pull request #30 from bdelwood/feat-ports
Browse files Browse the repository at this point in the history
Adding configuration options for ports
  • Loading branch information
Addyvan authored Jul 18, 2021
2 parents dd7e290 + 54d5fdf commit e3d16d6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ helm install valheim-server valheim-k8s/valheim-k8s \
| `storage.pvc.storageClassName` | The storageClass used to create the persistentVolumeClaim | `default` |
| `storage.pvc.size` | The size of the persistent volume to be created | `1Gi` |
| `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.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` |
Expand Down
12 changes: 6 additions & 6 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ spec:
value: {{ .Values.worldName }}
- name: SERVER_PASS
value: {{ .Values.password }}
- name: SERVER_PORT
value: {{ .Values.networking.gamePort | quote }}
{{ if .Values.extraEnvironmentVars -}}
{{ range $key, $value := .Values.extraEnvironmentVars }}
- name: {{ $key }}
value: {{ $value | quote }}
{{ end -}}
{{ end -}}
ports:
- containerPort: 2456
name: game1
- containerPort: 2457
name: game2
- containerPort: 2458
name: game3
- containerPort: {{ .Values.networking.gamePort | int }}
name: gameport
- containerPort: {{ .Values.networking.gamePort | int | add 1 }}
name: queryport
volumeMounts:
{{ if .Values.storage.kind }}
- mountPath: /config
Expand Down
18 changes: 8 additions & 10 deletions chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ metadata:
name: valheim-server
spec:
ports:
- name: game1
port: 2456
targetPort: 2456
- name: gameport
port: {{ .Values.networking.gamePort | int }}
targetPort: {{ .Values.networking.gamePort | int }}
protocol: UDP
- name: game2
port: 2457
targetPort: 2457
protocol: UDP
- name: game3
port: 2458
targetPort: 2458
{{ if .Values.networking.publishQueryPort }}
- name: queryport
port: {{ .Values.networking.gamePort | int | add 1 }}
targetPort: {{ .Values.networking.gamePort | int | add 1 }}
protocol: UDP
{{ end }}
type: {{ .Values.networking.serviceType }}
selector:
app: valheim-server
4 changes: 4 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ storage:

networking:
serviceType: LoadBalancer
gamePort: 2456
publishQueryPort: "true"



nodeSelector: {}

Expand Down

0 comments on commit e3d16d6

Please sign in to comment.