feat: add Kubernetes manifests for astrbot and napcat deployment with services and persistent storage (#3901)
* feat: add Kubernetes manifests for astrbot and napcat deployment with services and persistent storage * chore: remove 11451 port --------- Co-authored-by: Soulter <905617992@qq.com>
This commit is contained in:
+2
-3
@@ -9,10 +9,9 @@ services:
|
||||
restart: always
|
||||
ports: # mappings description: https://github.com/AstrBotDevs/AstrBot/issues/497
|
||||
- "6185:6185" # 必选,AstrBot WebUI 端口
|
||||
- "6195:6195" # 可选, 企业微信 Webhook 端口
|
||||
- "6199:6199" # 可选, QQ 个人号 WebSocket 端口
|
||||
- "6196:6196" # 可选, QQ 官方接口 Webhook 端口
|
||||
- "11451:11451" # 可选, 微信个人号 Webhook 端口
|
||||
# - "6195:6195" # 可选, 企业微信 Webhook 端口
|
||||
# - "6196:6196" # 可选, QQ 官方接口 Webhook 端口
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
volumes:
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: astrbot-standalone-ns
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: astrbot-data-pvc
|
||||
namespace: astrbot-standalone-ns
|
||||
labels:
|
||||
app: astrbot-standalone
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
# storageClassName: standard # uncomment and set proper StorageClass
|
||||
@@ -0,0 +1,49 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: astrbot-standalone
|
||||
namespace: astrbot-standalone-ns
|
||||
labels:
|
||||
app: astrbot-standalone
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: astrbot-standalone
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: astrbot-standalone
|
||||
spec:
|
||||
containers:
|
||||
- name: astrbot
|
||||
image: soulter/astrbot:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: TZ
|
||||
value: "Asia/Shanghai"
|
||||
ports:
|
||||
- containerPort: 6185
|
||||
name: webui
|
||||
- containerPort: 6199
|
||||
name: qq-ws
|
||||
# - containerPort: 6195
|
||||
# name: wecom-wh
|
||||
# - containerPort: 6196
|
||||
# name: qq-off-wh
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /AstrBot/data
|
||||
- name: localtime
|
||||
mountPath: /etc/localtime
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: astrbot-data-pvc
|
||||
- name: localtime
|
||||
hostPath:
|
||||
path: /etc/localtime
|
||||
type: File
|
||||
@@ -0,0 +1,28 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: astrbot-standalone-nodeport
|
||||
namespace: astrbot-standalone-ns
|
||||
labels:
|
||||
app: astrbot-standalone
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: astrbot-standalone
|
||||
ports:
|
||||
- name: webui
|
||||
port: 6185
|
||||
targetPort: 6185
|
||||
nodePort: 30185
|
||||
- name: qq-ws
|
||||
port: 6199
|
||||
targetPort: 6199
|
||||
nodePort: 30199
|
||||
# - name: wecom-wh
|
||||
# port: 6195
|
||||
# targetPort: 6195
|
||||
# nodePort: 30195
|
||||
# - name: qq-off-wh
|
||||
# port: 6196
|
||||
# targetPort: 6196
|
||||
# nodePort: 30196
|
||||
@@ -0,0 +1,24 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: astrbot-standalone-lb
|
||||
namespace: astrbot-standalone-ns
|
||||
labels:
|
||||
app: astrbot-standalone
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: astrbot-standalone
|
||||
ports:
|
||||
- name: webui
|
||||
port: 6185
|
||||
targetPort: 6185
|
||||
- name: qq-ws
|
||||
port: 6199
|
||||
targetPort: 6199
|
||||
# - name: wecom-wh
|
||||
# port: 6195
|
||||
# targetPort: 6195
|
||||
# - name: qq-off-wh
|
||||
# port: 6196
|
||||
# targetPort: 6196
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: astrbot-ns
|
||||
@@ -0,0 +1,46 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: astrbot-data-shared-pvc
|
||||
namespace: astrbot-ns
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
# storageClassName: nfs-client # Uncomment and set your RWX storage class if needed
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: napcat-config-pvc
|
||||
namespace: astrbot-ns
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
# storageClassName: standard
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: napcat-qq-pvc
|
||||
namespace: astrbot-ns
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
# storageClassName: standard
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: astrbot-stack
|
||||
namespace: astrbot-ns
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate # Use Recreate strategy for stateful applications
|
||||
selector:
|
||||
matchLabels:
|
||||
app: astrbot-stack
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
containers:
|
||||
- name: napcat
|
||||
image: mlikiowa/napcat-docker:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: NAPCAT_UID
|
||||
value: "1000"
|
||||
- name: NAPCAT_GID
|
||||
value: "1000"
|
||||
- name: MODE
|
||||
value: "astrbot"
|
||||
ports:
|
||||
- containerPort: 6099
|
||||
name: napcat-web
|
||||
volumeMounts:
|
||||
- name: shared-data
|
||||
mountPath: /AstrBot/data
|
||||
- name: napcat-config
|
||||
mountPath: /app/napcat/config
|
||||
- name: napcat-qq
|
||||
mountPath: /app/.config/QQ
|
||||
|
||||
- name: astrbot
|
||||
image: soulter/astrbot:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: TZ
|
||||
value: "Asia/Shanghai"
|
||||
ports:
|
||||
- containerPort: 6185
|
||||
name: astrbot-web
|
||||
volumeMounts:
|
||||
- name: shared-data
|
||||
mountPath: /AstrBot/data
|
||||
|
||||
volumes:
|
||||
- name: shared-data
|
||||
persistentVolumeClaim:
|
||||
claimName: astrbot-data-shared-pvc
|
||||
- name: napcat-config
|
||||
persistentVolumeClaim:
|
||||
claimName: napcat-config-pvc
|
||||
- name: napcat-qq
|
||||
persistentVolumeClaim:
|
||||
claimName: napcat-qq-pvc
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: astrbot-service-nodeport
|
||||
namespace: astrbot-ns
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: astrbot-stack
|
||||
ports:
|
||||
- name: napcat-web
|
||||
port: 6099
|
||||
targetPort: 6099
|
||||
# nodePort: 30099 # Optional: Specify a fixed NodePort if needed, otherwise remove this line
|
||||
- name: astrbot-web
|
||||
port: 6185
|
||||
targetPort: 6185
|
||||
# nodePort: 30185 # Optional: Specify a fixed NodePort if needed, otherwise remove this line
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: astrbot-service-lb
|
||||
namespace: astrbot-ns
|
||||
labels:
|
||||
app: astrbot-stack
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: astrbot-stack
|
||||
ports:
|
||||
- name: napcat-web
|
||||
port: 6099
|
||||
targetPort: 6099
|
||||
- name: astrbot-web
|
||||
port: 6185
|
||||
targetPort: 6185
|
||||
Reference in New Issue
Block a user