Files
NianAIGC/deploy/ack/web.yaml

79 lines
2.0 KiB
YAML

# Stateless static frontend. Nginx serves the exported Next.js files only; all
# /api, /uploads, and /generated-results traffic belongs to zhinian-go-api.
apiVersion: apps/v1
kind: Deployment
metadata:
name: zhinian-web
namespace: zhinian
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app.kubernetes.io/name: zhinian
app.kubernetes.io/component: web
template:
metadata:
labels:
app.kubernetes.io/name: zhinian
app.kubernetes.io/component: web
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 101
runAsGroup: 101
fsGroup: 101
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
containers:
- name: web
image: REGISTRY/PROJECT/zhinian-aigc:REPLACE_TAG
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3000
startupProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 20
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: 25m
memory: 32Mi
limits:
cpu: 250m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: nginx-tmp
mountPath: /tmp
volumes:
- name: nginx-tmp
emptyDir: {}