mirror of https://github.com/Mai-with-u/MaiBot.git
编写napcat的清单模板
parent
a72fc3b9f4
commit
7f719fd3b7
|
|
@ -0,0 +1,23 @@
|
||||||
|
{{- if .Values.napcat.enabled and .Values.napcat.ingress.enabled }}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-maibot-napcat
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
annotations: {{ .Values.napcat.ingress.annotations }}
|
||||||
|
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 }}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{{- if .Values.napcat.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-maibot-napcat
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
spec:
|
||||||
|
accessModes: {{ .Values.napcat.persistence.accessModes }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.napcat.persistence.size }}
|
||||||
|
storageClassName: {{ .Values.napcat.persistence.storageClass | default nil }}
|
||||||
|
{{- end }}
|
||||||
|
|
@ -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 }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}-maibot-napcat
|
||||||
|
type: {{ .Values.napcat.service.type }}
|
||||||
|
{{- end }}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
{{- 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 }}:{{ .Values.napcat.image.tag }}
|
||||||
|
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
|
||||||
|
resources: {{ .Values.napcat.resources }}
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /app/napcat/config
|
||||||
|
name: napcat
|
||||||
|
subPath: config
|
||||||
|
- mountPath: /app/.config/QQ
|
||||||
|
name: napcat
|
||||||
|
subPath: data
|
||||||
|
imagePullSecrets: {{ .Values.napcat.image.pullSecrets }}
|
||||||
|
nodeSelector: {{ .Values.napcat.nodeSelector }}
|
||||||
|
tolerations: {{ .Values.napcat.tolerations }}
|
||||||
|
volumes:
|
||||||
|
- name: napcat
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Release.Name }}-maibot-napcat
|
||||||
|
{{- end }}
|
||||||
Loading…
Reference in New Issue