Files
k3s-homelab/apps/vikunja/vikunja-deployment.yaml
T
2026-09-02 12:54:12 -07:00

93 lines
3.0 KiB
YAML

# Single-replica because Vikunja uses SQLite on a ReadWriteOnce volume: never run
# two pods against the same .db file. Recreate (not RollingUpdate) guarantees the
# old pod is gone before the new one starts, so migrations and writes can't collide.
apiVersion: apps/v1
kind: Deployment
metadata:
name: vikunja
namespace: vikunja
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: vikunja
template:
metadata:
labels:
app: vikunja
spec:
securityContext:
# The official image sets USER 1000 and the install docs chown /db and the
# files dir to 1000. local-path volumes are root-owned, so fsGroup 1000 makes
# the kubelet hand the PVCs to group 1000, which the process (uid 1000 / gid
# 1000) matches. Without this Vikunja cannot write /db/vikunja.db or files.
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: vikunja
image: vikunja/vikunja:2.6.0
ports:
- name: http
containerPort: 3456
env:
- name: VIKUNJA_SERVICE_PUBLICURL
value: https://vikunja.aleshym.co/
- name: VIKUNJA_DATABASE_TYPE
value: sqlite
- name: VIKUNJA_DATABASE_PATH
value: /db/vikunja.db
- name: VIKUNJA_FILES_BASEPATH
value: /app/vikunja/files
# Registration is on for initial setup so the first account can be created.
# Flip to "false" (see README) after that account exists.
- name: VIKUNJA_SERVICE_ENABLEREGISTRATION
value: "true"
- name: VIKUNJA_SERVICE_SECRET
valueFrom:
secretKeyRef:
name: vikunja-secret
key: VIKUNJA_SERVICE_SECRET
volumeMounts:
- name: db
mountPath: /db
- name: files
mountPath: /app/vikunja/files
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 30
periodSeconds: 30
# First boot runs SQLite database migrations, which can take longer than the
# liveness threshold. A startupProbe overrides liveness until it succeeds so
# the pod isn't killed mid-migration.
startupProbe:
httpGet:
path: /health
port: http
failureThreshold: 30
periodSeconds: 10
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
volumes:
- name: db
persistentVolumeClaim:
claimName: vikunja-db
- name: files
persistentVolumeClaim:
claimName: vikunja-files