Skip to content

Commit bd6a0e3

Browse files
committed
Add Kubernetes example configurations for Hytale server deployment
1 parent 562f5fb commit bd6a0e3

5 files changed

Lines changed: 117 additions & 0 deletions

File tree

examples/k8s/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
A Kubernetes example configuration for deploying the Hytale server.
2+
3+
## Files
4+
5+
- `namespace.yaml` - Creates a dedicated namespace for the Hytale server
6+
- `deployment.yaml` - Deploys the Hytale server container
7+
- `service.yaml` - Exposes the server via a NodePort service (UDP)
8+
- `pvc.yaml` - Persistent Volume Claim for server data
9+
10+
## Quick Start
11+
12+
1. Apply all manifests:
13+
14+
```bash
15+
kubectl apply -f examples/k8s/
16+
```
17+
18+
2. Or apply individually in order:
19+
20+
```bash
21+
kubectl apply -f examples/k8s/namespace.yaml
22+
kubectl apply -f examples/k8s/pvc.yaml
23+
kubectl apply -f examples/k8s/deployment.yaml
24+
kubectl apply -f examples/k8s/service.yaml
25+
```
26+
27+
## Accessing the Server
28+
29+
By default, the server is exposed via NodePort on port `30520`. Connect to your Hytale server using:
30+
31+
```
32+
<node-ip>:30520
33+
```
34+
35+
## Customization
36+
37+
- Modify the `pvc.yaml` to adjust storage size or use a different StorageClass
38+
- Update the `service.yaml` to use LoadBalancer type if your cluster supports it
39+
- Adjust resource limits in `deployment.yaml` based on your server requirements

examples/k8s/deployment.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: hytale-server
5+
namespace: hytale
6+
labels:
7+
app: hytale-server
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: hytale-server
13+
strategy:
14+
type: Recreate
15+
template:
16+
metadata:
17+
labels:
18+
app: hytale-server
19+
spec:
20+
containers:
21+
- name: hytale
22+
image: ghcr.io/zuedev/hytale-server-docker:main
23+
ports:
24+
- containerPort: 5520
25+
protocol: UDP
26+
name: game
27+
volumeMounts:
28+
- name: hytale-data
29+
mountPath: /app/Hytale
30+
stdin: true
31+
tty: true
32+
resources:
33+
requests:
34+
memory: "2Gi"
35+
cpu: "1"
36+
limits:
37+
memory: "4Gi"
38+
cpu: "2"
39+
volumes:
40+
- name: hytale-data
41+
persistentVolumeClaim:
42+
claimName: hytale-data

examples/k8s/namespace.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: hytale
5+
labels:
6+
app: hytale-server

examples/k8s/pvc.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: hytale-data
5+
namespace: hytale
6+
labels:
7+
app: hytale-server
8+
spec:
9+
accessModes:
10+
- ReadWriteOnce
11+
resources:
12+
requests:
13+
storage: 10Gi

examples/k8s/service.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: hytale-server
5+
namespace: hytale
6+
labels:
7+
app: hytale-server
8+
spec:
9+
type: NodePort
10+
selector:
11+
app: hytale-server
12+
ports:
13+
- port: 5520
14+
targetPort: 5520
15+
nodePort: 30520
16+
protocol: UDP
17+
name: game

0 commit comments

Comments
 (0)