video-shuoshan/k8s/backend-deployment.yaml
zyc d75d35dfc0
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 2m22s
Migrate deployment from Volcengine VKE to K3s
- Switch CI/CD target from KUBE_CONFIG_VKE to KUBE_CONFIG_K3S
- Change ingress class from ALB to traefik (K3S built-in)
- Remove VCI annotations from deployments
- Restore imagePullSecrets for SWR registry access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 14:46:33 +08:00

135 lines
3.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: video-backend
labels:
app: video-backend
spec:
replicas: 1
selector:
matchLabels:
app: video-backend
template:
metadata:
labels:
app: video-backend
spec:
imagePullSecrets:
- name: swr-secret
containers:
- name: video-backend
image: ${CI_REGISTRY_IMAGE}/video-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
env:
- name: USE_MYSQL
value: "true"
- name: DJANGO_DEBUG
value: "False"
- name: DJANGO_ALLOWED_HOSTS
value: "*"
- name: DJANGO_SECRET_KEY
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: DJANGO_SECRET_KEY
# Database (Aliyun RDS)
- name: DB_HOST
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: DB_HOST
- name: DB_NAME
value: "video_auto"
- name: DB_USER
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: DB_USER
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: DB_PASSWORD
- name: DB_PORT
value: "3306"
# CORS
- name: CORS_ALLOWED_ORIGINS
value: "https://video-huoshan-web.airlabs.art"
# Log Center
- name: LOG_CENTER_URL
value: "https://qiyuan-log-center-api.airlabs.art"
- name: LOG_CENTER_ENABLED
value: "true"
- name: ENVIRONMENT
value: "production"
# TOS (from Secret)
- name: TOS_ACCESS_KEY
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: TOS_ACCESS_KEY
- name: TOS_SECRET_KEY
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: TOS_SECRET_KEY
- name: TOS_BUCKET
value: "airdrama-media"
- name: TOS_ENDPOINT
value: "https://tos-cn-beijing.volces.com"
- name: TOS_REGION
value: "cn-beijing"
- name: TOS_CDN_DOMAIN
value: "https://airdrama-media.tos-cn-beijing.volces.com"
# Seedance API (from Secret)
- name: ARK_API_KEY
valueFrom:
secretKeyRef:
name: video-backend-secrets
key: ARK_API_KEY
- name: SEEDANCE_ENABLED
value: "true"
livenessProbe:
httpGet:
path: /healthz/
port: 8000
httpHeaders:
- name: Host
value: localhost
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /healthz/
port: 8000
httpHeaders:
- name: Host
value: localhost
initialDelaySeconds: 15
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "1024Mi"
cpu: "1000m"
---
apiVersion: v1
kind: Service
metadata:
name: video-backend
spec:
selector:
app: video-backend
ports:
- protocol: TCP
port: 8000
targetPort: 8000