summaryrefslogtreecommitdiff
path: root/f3s/kobo-sync-server/helm-chart/templates/deployment.yaml
blob: e08e6ab8faca995721eb77d3544a420d765baeb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
apiVersion: apps/v1
kind: Deployment
metadata:
  name: koreader-sync-server
spec:
  replicas: 1
  # Recreate so the old pod fully terminates before the new one starts —
  # avoids NFS-lock races on the hostPath-backed PVC during rolling updates.
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: koreader-sync-server
  template:
    metadata:
      labels:
        app: koreader-sync-server
    spec:
      initContainers:
        - name: nfs-check-data
          image: busybox:stable
          command:
            - sh
            - -c
            - |
              test -f /mnt/.nfs-sentinel || (
                echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
                echo "refusing to start; node likely has NFS unmounted"
                echo "pod would otherwise bind-mount the local-XFS shadow"
                exit 1
              )
          volumeMounts:
            - name: data
              mountPath: /mnt
              readOnly: true
      containers:
        - name: koreader-sync-server
          image: koreader/kosync:latest
          ports:
            - containerPort: 17200
          volumeMounts:
            - name: data
              mountPath: /var/lib/redis
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: koreader-sync-server-data