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花费信息等),则可以启用此功能