---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: resilio-sync
  namespace: resilio
  labels:
    app.kubernetes.io/instance: resilio-sync
    app.kubernetes.io/name: resilio-sync
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: resilio-sync
      app.kubernetes.io/name: resilio-sync
  updateStrategy:
    type: RollingUpdate
  serviceName: resilio-sync
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: resilio-sync
        app.kubernetes.io/name: resilio-sync
      annotations:
        configmap.reloader.stakater.com/reload: resilio-config-file
    spec:
      containers:
      - image: linuxserver/resilio-sync:2.7.2.1375-ls95
        name: resilio-sync
        env:
        - name: TZ
          value: America/Chicago
        - name: PUID
          value: "1024"
        - name: PGID
          value: "100"
        - name: UMASK
          value: "022"
        ports:
        - containerPort: 8888
          name: web
        - containerPort: 55555
          name: sync
        volumeMounts:
        - name: config
          mountPath: /config
        - name: config-file
          mountPath: /config/sync.conf
          subPath: sync.conf
        - name: backup
          mountPath: /sync/backup
      volumes:
      - name: config-file
        configMap:
          name: resilio-config-file
      - name: backup
        nfs:
          path: /volume1/Backup
          server: ${DERPNAS_ADDR}
  volumeClaimTemplates:
  - metadata:
      name: config
    spec:
      accessModes:
      - ReadWriteOnce
      storageClassName: longhorn
      resources:
        requests:
          storage: 1Gi
