- loadConfig(): if config.json missing, create data/ dir, write default config with random sessionSecret and empty passwordHash, log instructions - loadData(): throw clear error if units.json missing instead of crashing opaquely - deployment.yaml: remove envFrom secretRef (SESSION_SECRET/PASSWORD_HASH not read from env — config.json on PVC is the source of truth)
71 lines
1.7 KiB
YAML
71 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: humor-units
|
|
labels:
|
|
app: humor-units
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: humor-units
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: humor-units
|
|
spec:
|
|
containers:
|
|
- name: humor-units
|
|
image: registry.nerdrage.cloud/dickloads:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 3000
|
|
env:
|
|
- name: PORT
|
|
value: "3000"
|
|
- name: HOST
|
|
value: "0.0.0.0"
|
|
- name: NODE_ENV
|
|
value: "production"
|
|
- name: ORIGIN
|
|
value: "https://humorunits.com"
|
|
- name: ALLOWED_ORIGINS
|
|
value: "https://humorunits.com,https://www.humorunits.com,https://dickloads.com,https://www.dickloads.com"
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /app/data
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 256Mi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: humor-units-data
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: humor-units-data
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 100Mi
|