Files
GraphRAGAgent/k8s/base/backend-deployment.yaml
admin 58079daba9
GraphRAG CI/CD / build-and-deploy (push) Failing after 3m49s
feat: 添加 Gitea Actions CI/CD — tag 驱动环境部署
- git push → 构建镜像 (sha-xxx) → 部署到 test (graphrag-test)
- git push --tags → 构建镜像 (vx.y.z) → 部署到 prod (graphrag-prod)
- DNS + hostAliases + nodeAffinity 固化到 deployment yaml
- 前后端均固定到 k8smaster 节点,便于 CI 导入 containerd 镜像
2026-06-18 14:26:15 +08:00

92 lines
2.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
labels:
app: graphrag
component: backend
spec:
replicas: 1
selector:
matchLabels:
app: graphrag
component: backend
template:
metadata:
labels:
app: graphrag
component: backend
spec:
hostAliases:
- ip: "10.42.0.1"
hostnames:
- keycloak.plfai.cn
dnsConfig:
options:
- name: ndots
value: "1"
- name: timeout
value: "3"
- name: attempts
value: "2"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- k8smaster
containers:
- name: backend
image: registry.plfai.cn/graphrag-backend:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
protocol: TCP
envFrom:
- configMapRef:
name: graphrag-config
- secretRef:
name: graphrag-secrets
volumeMounts:
- name: backend-data
mountPath: /app/backend/data
- name: mineru-output
mountPath: /app/mineru_mvp/output
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "2Gi"
cpu: "1000m"
startupProbe:
httpGet:
path: /api/v1/health
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 60
livenessProbe:
httpGet:
path: /api/v1/health
port: 8000
initialDelaySeconds: 0
periodSeconds: 30
failureThreshold: 3
readinessProbe:
httpGet:
path: /api/v1/health
port: 8000
initialDelaySeconds: 0
periodSeconds: 10
volumes:
- name: backend-data
persistentVolumeClaim:
claimName: backend-data-pvc
- name: mineru-output
persistentVolumeClaim:
claimName: mineru-output-pvc