Files
easyai-deploy/k8s/base/video-edit.yaml
T
chengcheng 024f9267a9 fix(security): drop SYS_ADMIN from video editor
The published service disables the Chromium sandbox and does not perform system administration operations, so the broad capability is unnecessary. Drop all capabilities, prevent privilege escalation, and use the runtime default seccomp profile.
2026-07-23 11:12:03 +08:00

101 lines
2.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: video-edit
labels:
app.kubernetes.io/name: video-edit
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: video-edit
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app.kubernetes.io/name: video-edit
spec:
serviceAccountName: easyai-workload
terminationGracePeriodSeconds: 60
containers:
- name: video-edit
image: registry.cn-shanghai.aliyuncs.com/easyaigc/videoedit:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 8000
envFrom:
- configMapRef:
name: easyai-app-config
- secretRef:
name: easyai-app-secret
env:
- name: PYTHONUNBUFFERED
value: "1"
- name: OMP_NUM_THREADS
value: "4"
- name: OPENBLAS_NUM_THREADS
value: "4"
volumeMounts:
- name: temp
mountPath: /app/temp
- name: dshm
mountPath: /dev/shm
readinessProbe:
httpGet:
path: /docs
port: http
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
livenessProbe:
httpGet:
path: /docs
port: http
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
resources:
requests:
cpu: "1"
memory: 2Gi
limits:
cpu: "2"
memory: 4Gi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: temp
emptyDir: {}
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 3Gi
---
apiVersion: v1
kind: Service
metadata:
name: video-edit
labels:
app.kubernetes.io/name: video-edit
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: video-edit
ports:
- name: http
port: 8000
targetPort: http