thijsvanloef / palworld-server-docker

A Docker Container to easily run a Palworld dedicated server.
https://hub.docker.com/r/thijsvanloef/palworld-server-docker
MIT License
2.43k stars 295 forks source link

Kubernetes | Palworld infinite Waiting for user info #76

Closed Enorshionari closed 9 months ago

Enorshionari commented 9 months ago

I'm making version for kubernetes based on docker-compose file with deployment, service and PVC. But for some reason main palworld container stuck on infinite Waiting for user info... And in 1 of 50 tries it write this:

Loading Steam API...OK

Connecting anonymously to Steam Public...
OK
Waiting for client config...
steamcmd has been disconnected from steam with result 3 (No Connection)

ERROR! Timed out waiting for AppInfo update.
OK
Waiting for user info...
FAILED (Timed out)
OK
>>> Starting the gameserver
Checking if config exists
No config found, generating one
cp: cannot stat '/palworld/DefaultPalWorldSettings.ini': No such file or directory
Setting rcon-enabled to true
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
Setting public ip to **masked_ip**
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
Setting public port to 8211
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
Setting server name to kubernetes-server-1
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
Setting server description to Palworld-Test-Server running in kubernetes by https://t.me/SevenSilentStar
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
sed: -e expression #1, char 101: unknown option to `s'
Setting server password to 12345
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
Setting server admin password to 12345
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
Setting max-players to 32
sed: can't read /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini: No such file or directory
/servermanager.sh: line 81: ./PalServer.sh: No such file or directory
>>> Doing a fresh install of the gameserver
time="2024-01-23T22:42:13Z" level=info msg="read crontab: cronlist"
tid(17) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/home/steam/Steam/logs/stderr.txt'
Logging directory: '/home/steam/Steam/logs'
[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
tid(32) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/home/steam/Steam/logs/stderr.txt'
Logging directory: '/home/steam/Steam/logs'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation - version 1705108307
-- type 'quit' to exit --
Loading Steam API...OK

Here my manifests. Service:

apiVersion: v1
kind: Service
metadata:
  name: palworld-service
spec:
  selector:
    app: palworld
  ports:
    - name: palworld-server
      protocol: UDP
      port: 8211
      targetPort: 8211
    - name: rcon
      protocol: TCP
      port: 25575
      targetPort: 25575
  type: LoadBalancer

Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: palworld-deployment
spec:
  strategy:
    type: Recreate
  replicas: 1
  selector:
    matchLabels:
      app: palworld
  template:
    metadata:
      labels:
        app: palworld
    spec:
      securityContext:
        fsGroup: 1000
      containers:
      - name: rcon
        resources:
          limits:
            cpu: 100m
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 256Mi
        image: outdead/rcon:latest
        command: ["/rcon", "-a", "192.168.88.91:25575", "-p", "12345"]
        volumeMounts:
        - name: palworld-data
          mountPath: /palworld
      - name: palworld-container
        resources:
          limits:
            cpu: 4
            memory: 16Gi
          requests:
            cpu: 4
            memory: 16Gi
        image: %private_registry%/docker-palworld-dedicated-server:651bee7028e624d9ff759513d8b4aea14a99ac89
        ports:
        - containerPort: 8211
          protocol: UDP
        - containerPort: 25575
          protocol: TCP
        env:
        - name: TIMEZONE
          value: "Europe/Berlin"
        - name: DEBIAN_FRONTEND
          value: "noninteractive"
        - name: PUID
          value: "0"
        - name: PGID
          value: "0"
        - name: ALWAYS_UPDATE_ON_START
          value: "true"
        - name: MAX_PLAYERS
          value: "32"
        - name: MULTITHREAD_ENABLED
          value: "true"
        - name: COMMUNITY_SERVER
          value: "true"
        - name: RCON_ENABLED
          value: "true"
        - name: PUBLIC_IP
          value: "**masked_ip**"
        - name: PUBLIC_PORT
          value: "8211"
        - name: SERVER_NAME
          value: "kubernetes-server-1"
        - name: SERVER_DESCRIPTION
          value: "Palworld-Test-Server running in kubernetes by https://t.me/SevenSilentStar"
        - name: SERVER_PASSWORD
          value: "12345"
        - name: ADMIN_PASSWORD
          value: "12345"
        - name: BACKUP_ENABLED
          value: "true"
        - name: BACKUP_CRON_EXPRESSION
          value: "0 * * * *"
        volumeMounts:
        - name: palworld-data
          mountPath: /palworld
      imagePullSecrets:
        - name: gitlab-pull-secret
      volumes:
      - name: palworld-data
        persistentVolumeClaim:
          claimName: palworld-pvc
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: palworld-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi

Also, some logs could be useful for troubleshooting:

~/Steam/logs$ cat stderr.txt
01/23 22:49:54 Init: Installing breakpad exception handler for appid(steam)/version(1705108307)/tid(32)
thijsvanloef commented 9 months ago

Hi @Enorshionari, thanks for taking the time to write an issue, at the moment there is an open pull request aimed to get my palworld container working for Kubernetes. You should check it out, no doubt your input would be helpful :) https://github.com/thijsvanloef/palworld-server-docker/pull/65

Enorshionari commented 9 months ago

I have no idea why, but after ~2 hours in this state game successfully pulled from steam and started server.

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...
steamcmd has been disconnected from steam with result 3 (No Connection)
FAILED (Timed out)
OK
>>> Starting the gameserver
Checking if config exists
Setting rcon-enabled to true
Setting public ip to %private-ip%
Setting public port to 8211
Setting server name to kubernetes-server-1
Setting server description to Palworld-Test-Server running in kubernetes by https://t.me/SevenSilentStar
sed: -e expression #1, char 101: unknown option to `s'
Setting server password to 12345
Setting server admin password to 12345
Setting max-players to 32
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
Shutdown handler: initalize.
- Existing per-process limit (soft=1048576, hard=1048576) is enough for us (need only 1048576)
Increasing per-process limit of core file size to infinity.
- Existing per-process limit (soft=18446744073709551615, hard=18446744073709551615) is enough for us (need only 18446744073709551615)
CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize
Setting breakpad minidump AppID = 2394010
[S_API FAIL] Tried to access Steam interface SteamUser021 before SteamAPI_Init succeeded.
[S_API FAIL] Tried to access Steam interface SteamFriends017 before SteamAPI_Init succeeded.
[S_API FAIL] Tried to access Steam interface STEAMAPPS_INTERFACE_VERSION008 before SteamAPI_Init succeeded.
[S_API FAIL] Tried to access Steam interface SteamNetworkingUtils004 before SteamAPI_Init succeeded.

Also, can someone clarify, do we need to use loadbalancer with direct access to pod via 8211 UDP and 25575 TCP?

alex4108 commented 9 months ago

Take a look at manifests here if you want inspiration of how I'm running this. Yes you need LoadBalancer type to get an external IP so others can connect.

https://github.com/alex4108/palworld-on-kubernetes

thijsvanloef commented 9 months ago

k8s support has just been merged https://github.com/thijsvanloef/palworld-server-docker/pull/65, closing the issue.