diff --git a/charts/trek/templates/deployment.yaml b/charts/trek/templates/deployment.yaml index 37d52b1c1..6727b683f 100644 --- a/charts/trek/templates/deployment.yaml +++ b/charts/trek/templates/deployment.yaml @@ -6,6 +6,12 @@ metadata: app: {{ include "trek.name" . }} spec: replicas: 1 + # TREK is a single-writer SQLite app on a ReadWriteOnce PVC, so the default + # RollingUpdate would start a second pod holding the same volume before the old one + # exits — a Multi-Attach deadlock, or two processes on one travel.db. Recreate tears + # the old pod down first. Override to RollingUpdate only with a ReadWriteMany volume. + strategy: + type: {{ .Values.updateStrategy | default "Recreate" }} selector: matchLabels: app: {{ include "trek.name" . }} diff --git a/charts/trek/values.yaml b/charts/trek/values.yaml index a0523ce14..150e89851 100644 --- a/charts/trek/values.yaml +++ b/charts/trek/values.yaml @@ -4,6 +4,11 @@ image: # tag: latest pullPolicy: IfNotPresent +# Deployment update strategy. Recreate is the safe default for the single-writer SQLite +# DB on a ReadWriteOnce volume (the old pod is torn down before the new one starts). +# Set to RollingUpdate only if you back the data volume with ReadWriteMany storage. +updateStrategy: Recreate + # Optional image pull secrets for private registries imagePullSecrets: [] # - name: my-registry-secret diff --git a/docker-compose.yml b/docker-compose.yml index 3a343f791..2ba3340d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: app: - image: mauriceboe/trek:dev + image: mauriceboe/trek:latest container_name: trek read_only: true security_opt: