refactor: 调整helm chart目录结构
This commit is contained in:
13
helm-chart/templates/core/configmap.yaml
Normal file
13
helm-chart/templates/core/configmap.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-maibot-core
|
||||
namespace: {{ .Release.Namespace }}
|
||||
data:
|
||||
.env: |
|
||||
HOST=0.0.0.0
|
||||
PORT=8000
|
||||
model_config.toml: |
|
||||
{{ .Values.config.core_model_config | nindent 4 }}
|
||||
bot_config.toml: |
|
||||
{{ .Values.config.core_bot_config | nindent 4 }}
|
||||
16
helm-chart/templates/core/pvc.yaml
Normal file
16
helm-chart/templates/core/pvc.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-maibot-core
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
{{- if .Values.core.persistence.accessModes }}
|
||||
accessModes:
|
||||
{{ toYaml .Values.core.persistence.accessModes | nindent 4 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.core.persistence.size }}
|
||||
{{- if .Values.core.persistence.storageClass }}
|
||||
storageClassName: {{ .Values.core.persistence.storageClass | default nil }}
|
||||
{{- end }}
|
||||
16
helm-chart/templates/core/service.yaml
Normal file
16
helm-chart/templates/core/service.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-maibot-core
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: {{ .Release.Name }}-maibot-core
|
||||
spec:
|
||||
ports:
|
||||
- name: adapter-ws
|
||||
port: 8000
|
||||
protocol: TCP
|
||||
targetPort: 8000
|
||||
selector:
|
||||
app: {{ .Release.Name }}-maibot-core
|
||||
type: ClusterIP
|
||||
101
helm-chart/templates/core/statefulset.yaml
Normal file
101
helm-chart/templates/core/statefulset.yaml
Normal file
@@ -0,0 +1,101 @@
|
||||
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: 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/volume-linker.sh
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Shanghai
|
||||
- name: EULA_AGREE
|
||||
value: 99f08e0cab0190de853cb6af7d64d4de
|
||||
- name: PRIVACY_AGREE
|
||||
value: 9943b855e72199d0f5016ea39052f1b6
|
||||
image: {{ .Values.core.image.repository | default "reg.mikumikumi.xyz/maibot/maibot" }}:{{ .Values.core.image.tag | default "tag-0.10.3-beta" }}
|
||||
imagePullPolicy: {{ .Values.core.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: adapter-ws
|
||||
protocol: TCP
|
||||
{{- if .Values.core.resources }}
|
||||
resources:
|
||||
{{ toYaml .Values.core.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- mountPath: /MaiMBot/data
|
||||
name: data
|
||||
- mountPath: /MaiMBot/volume-linker.sh
|
||||
name: scripts
|
||||
readOnly: true
|
||||
subPath: volume-linker.sh
|
||||
- mountPath: /MaiMBot/.env
|
||||
name: config
|
||||
readOnly: true
|
||||
subPath: .env
|
||||
- mountPath: /MaiMBot/config/model_config.toml
|
||||
name: config
|
||||
readOnly: true
|
||||
subPath: model_config.toml
|
||||
- mountPath: /MaiMBot/config/bot_config.toml
|
||||
name: config
|
||||
readOnly: true
|
||||
subPath: bot_config.toml
|
||||
{{- if .Values.statistics_dashboard.enabled }}
|
||||
- mountPath: /MaiMBot/statistics
|
||||
name: statistics
|
||||
{{- end }}
|
||||
{{- 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: volume-linker.sh
|
||||
path: volume-linker.sh
|
||||
name: {{ .Release.Name }}-maibot-scripts
|
||||
name: scripts
|
||||
- configMap:
|
||||
items:
|
||||
- key: .env
|
||||
path: .env
|
||||
- key: model_config.toml
|
||||
path: model_config.toml
|
||||
- key: bot_config.toml
|
||||
path: bot_config.toml
|
||||
name: {{ .Release.Name }}-maibot-core
|
||||
name: config
|
||||
{{- if .Values.statistics_dashboard.enabled }}
|
||||
- name: statistics
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Release.Name }}-maibot-statistics-dashboard
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user