feat(helm chart): 挂载adapter的配置文件pvc到core中,为WebUI提供修改adapter配置的能力。

pull/1458/head
zhangxinhui02 2025-12-23 14:58:23 +08:00
parent f8b7873422
commit 0bfff0457e
No known key found for this signature in database
GPG Key ID: 22C23383864A313F
2 changed files with 18 additions and 7 deletions

View File

@ -85,7 +85,7 @@ helm install maimai \
从旧版本升级的用户旧的ConfigMap的配置会自动迁移到新的存储卷的配置文件中。
### 动态生成的ConfigMap
### 部署时自动重置的配置
adapter的配置中的`napcat_server`和`maibot_server`的`host`和`port`字段,会在每次部署/更新Helm安装实例时被自动重置。
@ -96,14 +96,19 @@ adapter的配置中的`napcat_server`和`maibot_server`的`host`和`port`字段
因此首次部署时ConfigMap的生成会需要一些时间部分Pod会无法启动等待几分钟即可。
### 运行统计看板与core的挂载冲突
### 跨节点PVC挂载问题
如果启用了运行统计看板那么statistics_dashboard会与core共同挂载statistics_dashboard存储卷用于同步html文件
MaiBot的一些组件会挂载同一PVC这主要是为了同步数据或修改配置
如果k8s集群有多个节点statistics_dashboard与core未调度到同一节点那么就需要statistics_dashboard的PVC访问模式具备`ReadWriteMany`访问模式。
如果k8s集群有多个节点共享相同PVC的Pod未调度到同一节点那么就需要此PVC访问模式具备`ReadWriteMany`访问模式。
不是所有存储卷的底层存储都支持`ReadWriteMany`访问模式。
不是所有存储控制器都支持`ReadWriteMany`访问模式。
如果你的存储底层无法支持`ReadWriteMany`访问模式,你可以通过`nodeSelector`配置将statistics_dashboard与core调度到同一节点来避免问题。
如果你的存储控制器无法支持`ReadWriteMany`访问模式,你可以通过`nodeSelector`配置将彼此之间共享相同PVC的Pod调度到同一节点来避免问题。
*对于预处理任务和`sqlite-web`,上述问题也同样会出现,需要注意。*
会共享PVC的组件列表
- `core`和`adapter`:共享`adapter-config`,用于为`core`的WebUI提供修改adapter的配置文件的能力。
- `core`和`statistics-dashboard`:共享`statistics-dashboard`用于同步统计数据的html文件。
- `core`和`sqlite-web`:共享`maibot-core`,用于为`sqlite-web`提供操作MaiBot数据库的能力。
- 部署时的预处理任务`preprocessor`和`adapter`、`core`:共享`adapter-config`和`core-config`,用于初始化`core`和`adapter`的配置文件。

View File

@ -60,6 +60,9 @@ spec:
- mountPath: /MaiMBot/config/bot_config.toml
name: config
subPath: bot_config.toml
- mountPath: /MaiMBot/adapters-config/config.toml # WebUI修改adapter配置所用
name: adapter-config
subPath: config.toml
{{- if .Values.statistics_dashboard.enabled }}
- mountPath: /MaiMBot/statistics
name: statistics
@ -90,6 +93,9 @@ spec:
- name: config
persistentVolumeClaim:
claimName: {{ .Release.Name }}-maibot-core-config
- name: adapter-config
persistentVolumeClaim:
claimName: {{ .Release.Name }}-maibot-adapter-config
{{- if .Values.statistics_dashboard.enabled }}
- name: statistics
persistentVolumeClaim: