Files
mai-bot/helm-chart/templates/core/statefulset.yaml

104 lines
3.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-maibot-core
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Release.Name }}-maibot-core
spec:
serviceName: {{ .Release.Name }}-maibot-core
replicas: 0 # post-install任务初始化完毕后自动扩容至1
selector:
matchLabels:
app: {{ .Release.Name }}-maibot-core
template:
metadata:
labels:
app: {{ .Release.Name }}-maibot-core
spec:
containers:
- name: core
command: # 为了在k8s中初始化这里替换启动命令为指定脚本
- sh
args:
- /MaiMBot/k8s-init.sh
env:
- name: TZ
value: "Asia/Shanghai"
- name: EULA_AGREE
value: "1b662741904d7155d1ce1c00b3530d0d"
- name: PRIVACY_AGREE
value: "9943b855e72199d0f5016ea39052f1b6"
image: {{ .Values.core.image.repository | default "sengokucola/maibot" }}:{{ .Values.core.image.tag | default "0.11.6-beta" }}
imagePullPolicy: {{ .Values.core.image.pullPolicy }}
ports:
- containerPort: 8000
name: adapter-ws
protocol: TCP
{{- if .Values.core.webui.enabled }}
- containerPort: 8001
name: webui
protocol: TCP
{{- end }}
{{- if .Values.core.resources }}
resources:
{{ toYaml .Values.core.resources | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /MaiMBot/data
name: data
- mountPath: /MaiMBot/k8s-init.sh
name: scripts
readOnly: true
subPath: k8s-init.sh
- mountPath: /MaiMBot/.env
name: config
subPath: .env
- mountPath: /MaiMBot/config/model_config.toml
name: config
subPath: model_config.toml
- 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
{{- end }}
serviceAccountName: {{ .Release.Name }}-maibot-sa
{{- if .Values.core.image.pullSecrets }}
imagePullSecrets:
{{ toYaml .Values.core.image.pullSecrets | nindent 8 }}
{{- end }}
{{- if .Values.core.nodeSelector }}
nodeSelector:
{{ toYaml .Values.core.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.core.tolerations }}
tolerations:
{{ toYaml .Values.core.tolerations | nindent 8 }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-maibot-core
- configMap:
items:
- key: k8s-init.sh
path: k8s-init.sh
name: {{ .Release.Name }}-maibot-scripts
name: scripts
- 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:
claimName: {{ .Release.Name }}-maibot-statistics-dashboard
{{- end }}