From 28fb4a9ad3d25f5dbcf559dcbe62ff62b8d368ed Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 23 Jan 2024 10:48:06 +0100 Subject: [PATCH] fix: added basic yamls for kubernetes support. --- k8s/deployment.yaml | 54 +++++++++++++++++++++++++++++++++++++++++++++ k8s/pvc.yaml | 15 +++++++++++++ k8s/readme.md | 5 +++++ k8s/service.yaml | 24 ++++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 k8s/deployment.yaml create mode 100644 k8s/pvc.yaml create mode 100644 k8s/readme.md create mode 100644 k8s/service.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..b93f6c3 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,54 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: palworld-server + name: palworld-server + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + app: palworld-server + template: + metadata: + labels: + app: palworld-server + spec: + containers: + - env: + - name: "PLAYERS" + value: "16" + - name: "PORT" + value: "8211" + - name: "MULTITHREADING" + value: "true" + - name: "COMMUNITY" + value: "true" + - name: "SERVER_NAME" + value: "YOUR SERVER NAME" + - name: "ADMIN_PASSWORD" + value: "YOURPASSWORD" + - name: "UPDATE_ON_BOOT" + value: "true" + image: thijsvanloef/palworld-server-docker + imagePullPolicy: IfNotPresent + name: palworld-server + ports: + - containerPort: 8211 + name: "8211-palworld" + protocol: UDP + - containerPort: 27015 + name: "27015-palworld" + protocol: UDP + resources: + requests: + cpu: 500m + memory: 512Mi + volumeMounts: + - mountPath: /palworld + name: datadir + volumes: + - name: datadir + persistentVolumeClaim: + claimName: palworld-server-datadir \ No newline at end of file diff --git a/k8s/pvc.yaml b/k8s/pvc.yaml new file mode 100644 index 0000000..63470cc --- /dev/null +++ b/k8s/pvc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: palworld-server + name: palworld-server-datadir + namespace: default +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: local-path + volumeMode: Filesystem \ No newline at end of file diff --git a/k8s/readme.md b/k8s/readme.md new file mode 100644 index 0000000..56c8f57 --- /dev/null +++ b/k8s/readme.md @@ -0,0 +1,5 @@ +# Setup Palworld in kubernetes + +kubectl apply -f pvc.yaml +kubectl apply -f service.yaml +kubectl apply -f deployment.yaml \ No newline at end of file diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..25b970a --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: palworld-server + name: palworld-server + namespace: default +spec: + externalTrafficPolicy: Cluster + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ports: + - name: palworld1 + port: 8211 + protocol: UDP + targetPort: 8211 + - name: palworld2 + port: 27015 + protocol: UDP + targetPort: 27015 + selector: + app: palworld-server + type: LoadBalancer \ No newline at end of file