diff --git a/apps/stardew/deployment.yaml b/apps/stardew/deployment.yaml deleted file mode 100644 index fe8ee3d..0000000 --- a/apps/stardew/deployment.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: stardew-server - namespace: stardew -spec: - replicas: 1 - selector: - matchLabels: - app: stardew - template: - metadata: - labels: - app: stardew - spec: - containers: - - name: stardew-server - image: stardew-valley-dedicated-server/server:latest # Prüfe das offizielle Image-Tag - env: - - name: SERVER_NAME - value: "Mein Homelab Server" - - name: PASSWORD - value: "DeinPasswort123" - ports: - - containerPort: 24642 - protocol: UDP - volumeMounts: - - name: stardew-storage - mountPath: /config # Standardpfad im Container - volumes: - - name: stardew-storage - persistentVolumeClaim: - claimName: stardew-data diff --git a/apps/stardew/pvc.yaml b/apps/stardew/pvc.yaml index 331198c..af78aac 100644 --- a/apps/stardew/pvc.yaml +++ b/apps/stardew/pvc.yaml @@ -1,11 +1,35 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: stardew-data - namespace: stardew # Passe deinen Namespace an + name: stardew-steam-session + namespace: stardew spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi # 1GB reicht für Spielstände völlig aus + accessModes: ["ReadWriteOnce"] + resources: { requests: { storage: 1Gi } } +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: stardew-game-data + namespace: stardew +spec: + accessModes: ["ReadWriteOnce"] + resources: { requests: { storage: 5Gi } } +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: stardew-saves + namespace: stardew +spec: + accessModes: ["ReadWriteOnce"] + resources: { requests: { storage: 1Gi } } +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: stardew-settings + namespace: stardew +spec: + accessModes: ["ReadWriteOnce"] + resources: { requests: { storage: 100Mi } } diff --git a/apps/stardew/server.yaml b/apps/stardew/server.yaml new file mode 100644 index 0000000..8b6713b --- /dev/null +++ b/apps/stardew/server.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: stardew-server + namespace: stardew +spec: + serviceName: stardew-server + replicas: 1 + selector: + matchLabels: + app: stardew-server + template: + metadata: + labels: + app: stardew-server + spec: + securityContext: + capabilities: + add: ["SYS_TIME"] + containers: + - name: server + image: sdvd/server:latest # Passe das ggf. an + envFrom: + - secretRef: + name: stardew-secrets + env: + - name: STEAM_AUTH_URL + value: "http://steam-auth:3001" + - name: SETTINGS_PATH + value: "/data/settings/server-settings.json" + volumeMounts: + - name: game + mountPath: /data/game + - name: saves + mountPath: /config/xdg/config/StardewValley + - name: settings + mountPath: /data/settings + volumes: + - name: game + persistentVolumeClaim: { claimName: stardew-game-data } + - name: saves + persistentVolumeClaim: { claimName: stardew-saves } + - name: settings + persistentVolumeClaim: { claimName: stardew-settings } + diff --git a/apps/stardew/service.yaml b/apps/stardew/service.yaml index 3fbbc44..93f4ff3 100644 --- a/apps/stardew/service.yaml +++ b/apps/stardew/service.yaml @@ -1,13 +1,24 @@ apiVersion: v1 kind: Service metadata: - name: stardew-service + name: stardew-server-svc namespace: stardew spec: + type: LoadBalancer # Oder NodePort, falls du keinen externen LB hast selector: - app: stardew + app: stardew-server ports: - - protocol: UDP - port: 24642 - targetPort: 24642 - type: LoadBalancer # Oder NodePort, falls du keinen LoadBalancer hast + - name: vnc + port: 5800 + targetPort: 5800 + - name: api + port: 8080 + targetPort: 8080 + - name: game-udp + port: 24642 + protocol: UDP + targetPort: 24642 + - name: query-udp + port: 27015 + protocol: UDP + targetPort: 27015 diff --git a/apps/stardew/steam-auth.yaml b/apps/stardew/steam-auth.yaml new file mode 100644 index 0000000..35061e2 --- /dev/null +++ b/apps/stardew/steam-auth.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: steam-auth + namespace: stardew +spec: + replicas: 1 + selector: + matchLabels: + app: steam-auth + template: + metadata: + labels: + app: steam-auth + spec: + containers: + - name: steam-auth + image: sdvd/steam-service:latest # Passe das ggf. an (Registry-Pfad) + envFrom: + - secretRef: + name: stardew-secrets + env: + - name: GAME_DIR + value: "/data/game" + - name: PORT + value: "3001" + volumeMounts: + - name: session + mountPath: /data/steam-session + - name: game + mountPath: /data/game + volumes: + - name: session + persistentVolumeClaim: { claimName: stardew-steam-session } + - name: game + persistentVolumeClaim: { claimName: stardew-game-data }