refactor(k8s): minimale, flache Manifeste zum Kopieren
Kustomize-Struktur (base/overlays) entfernt. Stattdessen nummerierte Einzeldateien, ausrollbar mit "kubectl apply -f k8s/": 00-namespace, 01-config, 02-storage (SMB-PVs/PVCs Postgres + Medien), 03-postgres (StatefulSet + Service), 04-app (Deployment mit Migrations-initContainer + Service), 05-ingress, 06-worker, 07-networkpolicy. Secrets als secrets.yaml.example (echte secrets.yaml ist gitignored). Images mit Tag latest aus der Gitea-Pipeline. Kurzanleitung in k8s/README.md, Betriebsdoku angepasst. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
c84eb1e740
commit
91791b791f
20 files changed
+332
-494
No files matched your search
@@ -0,0 +1,85 @@
|
||||
# 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:
|
||||
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 }
|
||||
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: 200m, memory: 256Mi }
|
||||
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: {}
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: artista-modelcamp-app
|
||||
namespace: artista
|
||||
spec:
|
||||
selector:
|
||||
app: artista-modelcamp-app
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: http
|
||||
Reference in new issue
Block a user