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>
63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: vaultwarden
|
|
labels:
|
|
app: vaultwarden
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: vaultwarden
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: vaultwarden
|
|
spec:
|
|
containers:
|
|
- name: vaultwarden
|
|
image: vaultwarden/server:1.32.7-alpine
|
|
resources:
|
|
requests:
|
|
memory: "128Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
ports:
|
|
- containerPort: 80
|
|
env:
|
|
- name: WEBSOCKET_ENABLED
|
|
value: "true"
|
|
- name: DOMAIN
|
|
value: "https://vaultwarden.lotimmy.com"
|
|
- name: ADMIN_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: vaultwarden-secret
|
|
key: ADMIN_TOKEN
|
|
# Health check
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /alive
|
|
port: 80
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /alive
|
|
port: 80
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
volumeMounts:
|
|
- mountPath: "/data"
|
|
name: data-vol
|
|
volumes:
|
|
- name: data-vol
|
|
persistentVolumeClaim:
|
|
claimName: vaultwarden-pvc
|