Files
k3s/apps/codimd/manifests/05-codimd-app-deployment.yaml
Timmy 3bf3ddd306 feat: improve security and stability for Vaultwarden and CodiMD
Security:
- Move Vaultwarden ADMIN_TOKEN to Secret (was plaintext)
- Remove root user execution from CodiMD (runAsUser: 0)
- Use fixed image versions instead of latest tag

Stability:
- Add liveness/readiness probes to Vaultwarden, CodiMD, CodiMD DB
- Add resource requests/limits to all services
- Set appropriate memory/CPU constraints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:52:30 +08:00

65 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: codimd-app
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: codimd
template:
metadata:
labels:
app: codimd
spec:
containers:
- name: codimd
image: hackmdio/hackmd:2.5.3-alpine
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
env:
- name: CMD_DB_URL
valueFrom:
secretKeyRef:
name: codimd-secrets
key: CMD_DB_URL
- name: CMD_USECDN
value: "false"
- name: CMD_DOMAIN
value: "codimd.lotimmy.com"
- name: CMD_PROTOCOL_USESSL
value: "true"
- name: CMD_CSP_ENABLE
value: "false"
# Health check (CodiMD has /healthz endpoint)
livenessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
volumeMounts:
- mountPath: "/home/hackmd/app/public/uploads"
name: upload-data
volumes:
- name: upload-data
persistentVolumeClaim:
claimName: codimd-upload-pvc