forked from xiaohei/taiji-AI-PAD
112 lines
2.2 KiB
YAML
112 lines
2.2 KiB
YAML
# NATS 消息队列部署配置
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: nats
|
|
namespace: taiji-ai
|
|
labels:
|
|
app: nats
|
|
component: messaging
|
|
spec:
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
app: nats
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: nats
|
|
component: messaging
|
|
spec:
|
|
containers:
|
|
- name: nats
|
|
image: nats:2.10-alpine
|
|
ports:
|
|
- containerPort: 4222
|
|
name: client
|
|
protocol: TCP
|
|
- containerPort: 6222
|
|
name: routing
|
|
protocol: TCP
|
|
- containerPort: 8222
|
|
name: monitoring
|
|
protocol: TCP
|
|
command:
|
|
- "/nats-server"
|
|
args:
|
|
- "-js"
|
|
- "-m"
|
|
- "8222"
|
|
- "-cluster"
|
|
- "nats://0.0.0.0:6222"
|
|
- "-routes"
|
|
- "nats://nats-0.nats.taiji-ai.svc.cluster.local:6222,nats://nats-1.nats.taiji-ai.svc.cluster.local:6222,nats://nats-2.nats.taiji-ai.svc.cluster.local:6222"
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
volumeMounts:
|
|
- name: nats-data
|
|
mountPath: /data
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: 8222
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: 8222
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: nats-data
|
|
persistentVolumeClaim:
|
|
claimName: nats-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: nats
|
|
namespace: taiji-ai
|
|
labels:
|
|
app: nats
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 4222
|
|
targetPort: 4222
|
|
protocol: TCP
|
|
name: client
|
|
- port: 6222
|
|
targetPort: 6222
|
|
protocol: TCP
|
|
name: routing
|
|
- port: 8222
|
|
targetPort: 8222
|
|
protocol: TCP
|
|
name: monitoring
|
|
selector:
|
|
app: nats
|
|
|
|
---
|
|
# NATS 持久化存储
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: nats-pvc
|
|
namespace: taiji-ai
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: managed-csi # Azure 托管存储类
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
|