rebours/k8s/deployment.yml
ordinarthur bf5bf977e9
All checks were successful
Build & Deploy to K3s / build-and-deploy (push) Successful in 4m13s
feat: replace Astro + Sanity + Fastify with Next.js + Payload CMS
Single Next.js 15 app now serves frontend SSR, admin CMS, and Stripe API.
Replaces the Sanity quota-limited headless CMS with self-hosted Payload 3.0
on Postgres, removing the split-service topology (ssr/api/proxy → web).

- nextjs/: Next.js 15 app with Payload 3.0, Postgres adapter, Stripe plugin
- k8s/: new single-pod deployment + Postgres StatefulSet + PVCs (media, db)
- .gitea/workflows/deploy.yml: single-image build, tears down legacy pods

New Gitea secrets required: PAYLOAD_SECRET, POSTGRES_PASSWORD.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 10:28:29 +02:00

74 lines
2.0 KiB
YAML

# ─── Media uploads volume (Payload writes to /app/media) ─────────────────────
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rebours-media-data
namespace: rebours
spec:
accessModes: [ReadWriteOnce]
storageClassName: local-path
resources:
requests:
storage: 5Gi
---
# ─── Next.js + Payload CMS (single process) ───────────────────────────────────
apiVersion: apps/v1
kind: Deployment
metadata:
name: rebours-web
namespace: rebours
labels:
app: rebours-web
spec:
replicas: 1
strategy:
# Single-replica app writing to a RWO volume — recreate instead of rolling
type: Recreate
selector:
matchLabels:
app: rebours-web
template:
metadata:
labels:
app: rebours-web
spec:
imagePullSecrets:
- name: gitea-registry-secret
containers:
- name: rebours-web
image: git.arthurbarre.fr/ordinarthur/rebours-web:latest
ports:
- containerPort: 3000
envFrom:
- configMapRef:
name: rebours-config
- secretRef:
name: rebours-secrets
volumeMounts:
- name: media
mountPath: /app/media
resources:
requests:
memory: "384Mi"
cpu: "200m"
limits:
memory: "1Gi"
cpu: "1000m"
readinessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 15
periodSeconds: 10
failureThreshold: 6
livenessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 30
periodSeconds: 30
volumes:
- name: media
persistentVolumeClaim:
claimName: rebours-media-data