refactor: 调整helm chart目录结构

This commit is contained in:
zhangxinhui02
2025-10-31 10:42:45 +08:00
parent cf41b36572
commit e983c938f7
23 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
{{- if and .Values.napcat.enabled .Values.napcat.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-maibot-napcat
namespace: {{ .Release.Namespace }}
{{- if .Values.napcat.ingress.annotations }}
annotations:
{{ toYaml .Values.napcat.ingress.annotations | nindent 4 }}
{{- end }}
labels:
app: {{ .Release.Name }}-maibot-napcat
spec:
ingressClassName: {{ .Values.napcat.ingress.className }}
rules:
- host: {{ .Values.napcat.ingress.host }}
http:
paths:
- backend:
service:
name: {{ .Release.Name }}-maibot-napcat
port:
number: {{ .Values.napcat.service.port }}
path: {{ .Values.napcat.ingress.path }}
pathType: {{ .Values.napcat.ingress.pathType }}
{{- end }}

View File

@@ -0,0 +1,18 @@
{{- if .Values.napcat.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-maibot-napcat
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.napcat.persistence.accessModes }}
accessModes:
{{ toYaml .Values.napcat.persistence.accessModes | nindent 4 }}
{{- end }}
resources:
requests:
storage: {{ .Values.napcat.persistence.size }}
{{- if .Values.napcat.persistence.storageClass }}
storageClassName: {{ .Values.napcat.persistence.storageClass | default nil }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,21 @@
{{- if .Values.napcat.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-maibot-napcat
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Release.Name }}-maibot-napcat
spec:
ports:
- name: webui
port: {{ .Values.napcat.service.port }}
protocol: TCP
targetPort: 6099
{{- if eq .Values.napcat.service.type "NodePort" }}
nodePort: {{ .Values.napcat.service.nodePort | default nil }}
{{- end }}
selector:
app: {{ .Release.Name }}-maibot-napcat
type: {{ .Values.napcat.service.type }}
{{- end }}

View File

@@ -0,0 +1,72 @@
{{- if .Values.napcat.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-maibot-napcat
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Release.Name }}-maibot-napcat
spec:
serviceName: {{ .Release.Name }}-maibot-napcat
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-maibot-napcat
template:
metadata:
labels:
app: {{ .Release.Name }}-maibot-napcat
spec:
containers:
- name: napcat
env:
- name: NAPCAT_GID
value: "{{ .Values.napcat.permission.gid }}"
- name: NAPCAT_UID
value: "{{ .Values.napcat.permission.uid }}"
- name: TZ
value: Asia/Shanghai
image: {{ .Values.napcat.image.repository | default "mlikiowa/napcat-docker" }}:{{ .Values.napcat.image.tag | default "v4.8.116" }}
imagePullPolicy: {{ .Values.napcat.image.pullPolicy }}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 6099
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 10
ports:
- containerPort: 6099
name: webui
protocol: TCP
{{- if .Values.napcat.resources }}
resources:
{{ toYaml .Values.napcat.resources | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /app/napcat/config
name: napcat
subPath: config
- mountPath: /app/.config/QQ
name: napcat
subPath: data
{{- if .Values.napcat.image.pullSecrets }}
imagePullSecrets:
{{ toYaml .Values.napcat.image.pullSecrets | nindent 8 }}
{{- end }}
{{- if .Values.napcat.nodeSelector }}
nodeSelector:
{{ toYaml .Values.napcat.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.napcat.tolerations }}
tolerations:
{{ toYaml .Values.napcat.tolerations | nindent 8 }}
{{- end }}
volumes:
- name: napcat
persistentVolumeClaim:
claimName: {{ .Release.Name }}-maibot-napcat
{{- end }}