Skip to content

Commit

Permalink
docs: add k8s/dockler sync desc
Browse files Browse the repository at this point in the history
  • Loading branch information
zaigie committed Feb 3, 2024
1 parent cb14ddb commit 7dc8cf3
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Due to limited maintenance and development staff, we welcome front-end, back-end
> If the conditions are not met and still needed, the `pst-agent` is deployed on the game server, and the `pst` is deployed on a PC or other server with enough memory to perform the parsing task.
>
> ==> [pst-agent deployment tutorial](./README.agent.en.md)
>
> And synchronization [Sync archive from K8s-pod](#synchronizing-archives-from-k8s-pod) can be replicated directly within the k8s cluster via the kubectl api.
Download the latest executable files at:

Expand Down Expand Up @@ -96,6 +98,8 @@ Please **shut down the server before making modifications**. Set an AdminPasswor
- [Docker Depolyment](#docker-deployment)
- [Monolithic Deployment](#monolithic-deployment)
- [Agent Deployment](#agent-deployment)
- [Synchronizing Archives from k8s-pod](#synchronizing-archives-from-k8s-pod)
- [Synchronizing Archives from Docker Container](#synchronizing-archives-from-docker-container)

Rimer believes that by **putting the pst tool and the game server on the same physical machine**, there are some situations where you might not want to deploy them on the same machine:

Expand Down Expand Up @@ -374,6 +378,52 @@ Then add `-v ./pst.db:/app/pst.db` in `docker run -v`.
| SAVE\_\_DECODE_PATH | "/app/sav_cli" | Text | ⚠️ Built into the container, do not modify, or it will cause save analysis tool errors |
| SAVE\_\_SYNC_INTERVAL | 600 | Number | Interval for syncing player save data |

#### Synchronizing Archives from k8s-pod

Starting from v0.5.3, it is supported to synchronize game server archives within a cluster without the need for an agent.

> Make sure that the serviceaccount used by pst has "pods/exec" permissions!

You only need to change the `SAVE__PATH` environment variable, in the following format:

```bash
SAVE__PATH="k8s://<namespace>/<podname>/<container>:<Game Archive Directory>"
```

For example:

```bash
SAVE__PATH="k8s://default/palworld-server-0/palworld-server:/palworld/Pal/Saved"
```

> Since the time and location (including HASH) of the Level.sav file created by the game server are uncertain at the first instance, you only need to point to the Saved directory level, and the program will automatically scan.

When pst and the game server are in the same namespace, you can omit it:

```bash
SAVE__PATH="k8s://palworld-server-0/palworld-server:/palworld/Pal/Saved"
```

### Synchronizing Archives from Docker Container

Starting from v0.5.3, it is supported to synchronize game server archives inside a container without the need for an agent (**temporarily only supports pst deployed in file deployment mode**).

You only need to change the `SAVE__PATH` environment variable, in the following format:

```bash
SAVE__PATH="docker://<container_name_or_id>:<Game Archive Directory>"
```

For example:

```bash
SAVE__PATH="docker://palworld-server:/palworld/Pal/Saved"
#or
SAVE__PATH="docker://04b0a9af4288:/palworld/Pal/Saved"
```

> Since the time and location (including HASH) of the Level.sav file created by the game server are uncertain at the first instance, you only need to point to the Saved directory level, and the program will automatically scan.

## REST API Document

[APIFox Online document](https://q4ly3bfcop.apifox.cn/)
Expand All @@ -388,3 +438,7 @@ Then add `-v ./pst.db:/app/pst.db` in `docker run -v`.
## LICENSE

According to the [Apache2.0 LICENSE](LICENSE) authorization, any reprints please indicate in the README and document section! Any commercial behavior must be informed!

```

```
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
> 若不满足条件仍需使用,提供了 `pst-agent` 部署在游戏服务器,而将 `pst` 部署在 PC 或者其它有足够内存执行解析任务的服务器。
>
> ==> [pst-agent 部署教程](./README.agent.md)
>
> 以及在 k8s 集群内可以直接通过 kubectl api 复制同步 [从 k8s-pod 同步存档](#从-k8s-pod-同步存档)
请在以下地址下载最新版可执行文件

Expand Down Expand Up @@ -97,6 +99,8 @@ AdminPassword=...,...,RCONEnabled=true,RCONPort=25575
- [Docker 部署](#docker-部署)
- [单体部署](#单体部署)
- [Agent 部署](#agent-部署)
- [从 k8s-pod 同步存档](#从-k8s-pod-同步存档)
- [从 docker 容器同步存档](#从-docker-容器同步存档)

这里**默认为将 pst 工具和游戏服务器放在同一台物理机上**,在一些情况下你可能不想要它们部署在同一机器上:

Expand Down Expand Up @@ -375,6 +379,52 @@ touch pst.db
| SAVE\_\_DECODE_PATH | "/app/sav_cli" | 文本 | ⚠️ 容器内置,禁止修改,会导致存档解析工具错误 |
| SAVE\_\_SYNC_INTERVAL | 600 | 数字 | 同步玩家存档数据的间隔 |

#### 从 k8s-pod 同步存档

从 v0.5.3 开始,支持无需 agent 同步集群内游戏服务器存档。

> 请确保 pst 所使用的 serviceaccount 具有 "pods/exec" 权限!

只需要更改 `SAVE__PATH` 环境变量即可,格式如下:

```bash
SAVE__PATH="k8s://<namespace>/<podname>/<container>:<游戏存档目录>"
```

比如:

```bash
SAVE__PATH="k8s://default/palworld-server-0/palworld-server:/palworld/Pal/Saved
```

> 由于游戏服务器创建 Level.sav 文件的时间、位置(包含 HASH)在初次都不确定,您只需要指向 Saved 目录级别即可,程序会自动扫描

当 pst 与游戏服务器在同一 namespace 下时,您可以省略它:

```bash
SAVE__PATH="k8s://palworld-server-0/palworld-server:/palworld/Pal/Saved
```

### 从 docker 容器同步存档

从 v0.5.3 开始,支持无需 agent 同步容器内游戏服务器存档(**暂时只支持以文件部署方式部署的 pst**)

只需要更改 `SAVE__PATH` 环境变量即可,格式如下:

```bash
SAVE__PATH="docker://<container_name_or_id>:<游戏存档目录>"
```

比如:

```bash
SAVE__PATH="docker://palworld-server:/palworld/Pal/Saved"
#or
SAVE__PATH="docker://04b0a9af4288:/palworld/Pal/Saved"
```

> 由于游戏服务器创建 Level.sav 文件的时间、位置(包含 HASH)在初次都不确定,您只需要指向 Saved 目录级别即可,程序会自动扫描

## 接口文档

[APIFox 在线接口文档](https://q4ly3bfcop.apifox.cn/)
Expand Down

0 comments on commit 7dc8cf3

Please sign in to comment.