From 16059532d8ef87ac28e2be0838ff8b3a34a91d0f Mon Sep 17 00:00:00 2001 From: zhangxinhui02 Date: Sat, 1 Nov 2025 01:37:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20helm=20chart=E6=96=B0=E5=A2=9E=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=8F=AF=E9=80=89=E5=90=AF=E7=94=A8=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=AE=B9=E5=99=A8=E8=87=AA=E5=8A=A8=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E9=BB=98=E8=AE=A4=E6=8F=92=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-chart/templates/core/statefulset.yaml | 4 ++++ helm-chart/templates/other/configmap-scripts.yaml | 2 ++ helm-chart/values.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/helm-chart/templates/core/statefulset.yaml b/helm-chart/templates/core/statefulset.yaml index bd6ab702..8bdc2077 100644 --- a/helm-chart/templates/core/statefulset.yaml +++ b/helm-chart/templates/core/statefulset.yaml @@ -62,6 +62,7 @@ spec: - mountPath: /MaiMBot/statistics name: statistics {{- end }} + {{- if .Values.core.setup_default_plugins }} initContainers: # 用户插件目录存储在存储卷中,会在启动时覆盖掉容器的默认插件目录。此初始化容器用于默认插件更新后或麦麦首次启动时为用户自动安装默认插件到存储卷中 - args: - setup-plugins.py @@ -79,6 +80,7 @@ spec: name: scripts readOnly: true subPath: setup-plugins.py + {{- end }} {{- if .Values.core.image.pullSecrets }} imagePullSecrets: {{ toYaml .Values.core.image.pullSecrets | nindent 8 }} @@ -99,8 +101,10 @@ spec: items: - key: volume-linker.sh path: volume-linker.sh + {{- if .Values.core.setup_default_plugins }} - key: setup-plugins.py path: setup-plugins.py + {{- end }} name: {{ .Release.Name }}-maibot-scripts name: scripts - configMap: diff --git a/helm-chart/templates/other/configmap-scripts.yaml b/helm-chart/templates/other/configmap-scripts.yaml index 145f090a..4d1e546f 100644 --- a/helm-chart/templates/other/configmap-scripts.yaml +++ b/helm-chart/templates/other/configmap-scripts.yaml @@ -8,5 +8,7 @@ data: volume-linker.sh: | {{ .Files.Get "files/volume-linker.sh" | nindent 4 }} # core的初始化容器 + {{- if .Values.core.setup_default_plugins }} setup-plugins.py: | {{ .Files.Get "files/setup-plugins.py" | nindent 4 }} + {{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index a7dd3d5c..d409231a 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -63,6 +63,8 @@ core: - ReadWriteOnce size: 10Gi + setup_default_plugins: true # 启用一个初始化容器,用于为用户自动安装默认插件到存储卷中 + # 麦麦的运行统计看板配置 # 麦麦每隔一段时间会自动输出html格式的运行统计报告,此统计报告可以作为静态网页访问 # 此功能默认禁用。如果你认为报告可以被公开访问(报告包含联系人/群组名称、模型token花费信息等),则可以启用此功能