airlabs-manage/k8s/backend-deployment-prod.yaml
zyc 3e7f0c028f
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m4s
fix: 后端健康检查改用TCP探针,修复CrashLoopBackOff
后端没有/api/health/路由,HTTP探针返回404导致Pod被反复重启,
改用tcpSocket探针检测8000端口即可。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:25:23 +08:00

76 lines
1.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: airlabs-manage-backend
labels:
app: airlabs-manage-backend
spec:
replicas: 1
selector:
matchLabels:
app: airlabs-manage-backend
template:
metadata:
labels:
app: airlabs-manage-backend
spec:
imagePullSecrets:
- name: cr-pull-secret
containers:
- name: airlabs-manage-backend
image: ${CI_REGISTRY_IMAGE}/backend:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
env:
# Database
- name: DB_HOST
value: "mysql8351f937d637.rds.ivolces.com"
- name: DB_NAME
value: "airlabs_manage"
- name: DB_USER
value: "zyc"
- name: DB_PASSWORD
value: "Zyc188208"
- name: DB_PORT
value: "3306"
# JWT 密钥
- name: SECRET_KEY
value: "Ui5-xEvtAhKRDtlXKzDfd7TElsVZFUhakff0qcjn8jU"
# CORS 允许的域名
- name: CORS_ORIGINS
value: "https://airlabs-manage-web.airlabs.art"
livenessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "1024Mi"
cpu: "1000m"
---
apiVersion: v1
kind: Service
metadata:
name: airlabs-manage-backend
spec:
selector:
app: airlabs-manage-backend
ports:
- protocol: TCP
port: 8000
targetPort: 8000