Files
Artista-Filmcamp/k8s/05-app-deployment.yaml
T
Nick SzaunigandClaude Opus 5.5 d3a7f8b824
Docker-Images bauen und veroeffentlichen / build-and-push (push) Canceled after 1m17s
chore(k8s): CPU- und Speicher-Reservierung entfernen
Requests stehen explizit auf 0 statt zu fehlen, weil Kubernetes einen
fehlenden Request auf das Limit setzt und dann noch mehr reserviert.
Die Limits bleiben als Obergrenze.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-10 04:08:14 +02:00

90 lines
2.7 KiB
YAML

# Website. Der initContainer migriert vor jedem Start die Datenbank.
# Update nach neuem Image: kubectl -n artista rollout restart deploy/artista-modelcamp-app
apiVersion: apps/v1
kind: Deployment
metadata:
name: artista-modelcamp-app
namespace: artista
spec:
replicas: 2
selector:
matchLabels:
app: artista-modelcamp-app
template:
metadata:
labels:
app: artista-modelcamp-app
db-client: "true"
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
seccompProfile: { type: RuntimeDefault }
initContainers:
- name: migrate
image: git.encry.de/nick.rosenloecher/artista-modelcamp-tools:latest
imagePullPolicy: Always
command: ["prisma", "migrate", "deploy"]
envFrom:
- secretRef: { name: artista-modelcamp-secrets }
resources:
requests: { cpu: "0", memory: "0" }
limits: { memory: 512Mi }
securityContext:
allowPrivilegeEscalation: false
capabilities: { drop: ["ALL"] }
containers:
- name: app
image: git.encry.de/nick.rosenloecher/artista-modelcamp:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 3000
envFrom:
- configMapRef: { name: artista-modelcamp-config }
- secretRef: { name: artista-modelcamp-secrets }
readinessProbe:
httpGet: { path: /api/health/ready, port: http }
periodSeconds: 10
livenessProbe:
httpGet: { path: /api/health, port: http }
initialDelaySeconds: 20
periodSeconds: 20
resources:
requests: { cpu: "0", memory: "0" }
limits: { memory: 768Mi }
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: { drop: ["ALL"] }
volumeMounts:
- name: media
mountPath: /app/media
readOnly: true
- name: cache
mountPath: /app/.next/cache
- name: tmp
mountPath: /tmp
volumes:
- name: media
persistentVolumeClaim: { claimName: artista-modelcamp-media }
- name: cache
emptyDir: { sizeLimit: 512Mi }
- name: tmp
emptyDir: { sizeLimit: 64Mi }
---
apiVersion: v1
kind: Service
metadata:
name: artista-modelcamp-app
namespace: artista
spec:
selector:
app: artista-modelcamp-app
ports:
- name: http
port: 80
targetPort: http