From 65f0515e80ccd139f392cf8fb4e11a4ec8dbfcd9 Mon Sep 17 00:00:00 2001 From: zhangxinhui02 Date: Wed, 20 Aug 2025 00:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=86=99statistics-dashboard=E7=9A=84?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/statistics-deployment.yaml | 49 +++++++++++++++++++ helm-chart/templates/statistics-ingress.yaml | 23 +++++++++ helm-chart/templates/statistics-pvc.yaml | 13 +++++ helm-chart/templates/statistics-service.yaml | 21 ++++++++ 4 files changed, 106 insertions(+) create mode 100644 helm-chart/templates/statistics-deployment.yaml create mode 100644 helm-chart/templates/statistics-ingress.yaml create mode 100644 helm-chart/templates/statistics-pvc.yaml create mode 100644 helm-chart/templates/statistics-service.yaml diff --git a/helm-chart/templates/statistics-deployment.yaml b/helm-chart/templates/statistics-deployment.yaml new file mode 100644 index 00000000..808257b6 --- /dev/null +++ b/helm-chart/templates/statistics-deployment.yaml @@ -0,0 +1,49 @@ +{{- if .Values.statistics_dashboard.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-maibot-statistics-dashboard + namespace: {{ .Release.Namespace }} + labels: + app: {{ .Release.Name }}-maibot-statistics-dashboard +spec: + replicas: {{ .Values.statistics_dashboard.replicaCount }} + selector: + matchLabels: + app: {{ .Release.Name }}-maibot-statistics-dashboard + template: + metadata: + labels: + app: {{ .Release.Name }}-maibot-statistics-dashboard + spec: + containers: + - name: nginx + image: {{ .Values.statistics_dashboard.image.repository }}:{{ .Values.statistics_dashboard.image.tag }} + imagePullPolicy: {{ .Values.statistics_dashboard.image.pullPolicy }} + livenessProbe: + failureThreshold: 3 + httpGet: + path: / + port: 80 + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + ports: + - containerPort: 80 + name: dashboard + protocol: TCP + resources: {{ .Values.statistics_dashboard.resources }} + volumeMounts: + - mountPath: /usr/share/nginx/html + name: statistics + readOnly: true + imagePullSecrets: {{ .Values.statistics_dashboard.image.pullSecrets }} + nodeSelector: {{ .Values.statistics_dashboard.nodeSelector }} + tolerations: {{ .Values.core.tolerations }} + volumes: + - name: statistics + persistentVolumeClaim: + claimName: {{ .Release.Name }}-maibot-statistics-dashboard +{{- end }} diff --git a/helm-chart/templates/statistics-ingress.yaml b/helm-chart/templates/statistics-ingress.yaml new file mode 100644 index 00000000..9c7c2a51 --- /dev/null +++ b/helm-chart/templates/statistics-ingress.yaml @@ -0,0 +1,23 @@ +{{- if .Values.statistics_dashboard.enabled and .Values.statistics_dashboard.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-maibot-statistics-dashboard + namespace: {{ .Release.Namespace }} + annotations: {{ .Values.statistics_dashboard.ingress.annotations }} + labels: + app: {{ .Release.Name }}-maibot-statistics-dashboard +spec: + ingressClassName: {{ .Values.statistics_dashboard.ingress.className }} + rules: + - host: {{ .Values.statistics_dashboard.ingress.host }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-maibot-statistics-dashboard + port: + number: {{ .Values.statistics_dashboard.service.port }} + path: {{ .Values.statistics_dashboard.ingress.path }} + pathType: {{ .Values.statistics_dashboard.ingress.pathType }} +{{- end }} diff --git a/helm-chart/templates/statistics-pvc.yaml b/helm-chart/templates/statistics-pvc.yaml new file mode 100644 index 00000000..783614ab --- /dev/null +++ b/helm-chart/templates/statistics-pvc.yaml @@ -0,0 +1,13 @@ +{{- if .Values.statistics_dashboard.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-maibot-statistics-dashboard + namespace: {{ .Release.Namespace }} +spec: + accessModes: {{ .Values.statistics_dashboard.persistence.accessModes }} + resources: + requests: + storage: {{ .Values.statistics_dashboard.persistence.size }} + storageClassName: {{ .Values.statistics_dashboard.persistence.storageClass | default nil }} +{{- end }} diff --git a/helm-chart/templates/statistics-service.yaml b/helm-chart/templates/statistics-service.yaml new file mode 100644 index 00000000..86d0d628 --- /dev/null +++ b/helm-chart/templates/statistics-service.yaml @@ -0,0 +1,21 @@ +{{- if .Values.statistics_dashboard.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-maibot-statistics-dashboard + namespace: {{ .Release.Namespace }} + labels: + app: {{ .Release.Name }}-maibot-statistics-dashboard +spec: + ports: + - name: dashboard + port: {{ .Values.statistics_dashboard.service.port }} + protocol: TCP + targetPort: 80 + {{- if eq .Values.statistics_dashboard.service.type "nodePort" }} + nodePort: {{ .Values.statistics_dashboard.service.nodePort }} + {{- end }} + selector: + app: {{ .Release.Name }}-maibot-statistics-dashboard + type: {{ .Values.statistics_dashboard.service.type }} +{{- end }}