apiVersion: apps/v1
kind: Deployment
metadata:
  name: syncthing
  labels:
    helm.sh/chart: syncthing-3.0.1
    app.kubernetes.io/name: syncthing
    app.kubernetes.io/instance: syncthing
    app.kubernetes.io/version: "1.17.0"
    app.kubernetes.io/managed-by: Helm
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: syncthing
      app.kubernetes.io/instance: syncthing
  template:
    metadata:
      labels:
        app.kubernetes.io/name: syncthing
        app.kubernetes.io/instance: syncthing
    spec:
      nodeSelector:
        hdd: enabled
      serviceAccountName: default
      dnsPolicy: ClusterFirst
      enableServiceLinks: true
      containers:
        - name: syncthing
          image: "syncthing/syncthing:1.17.0"
          imagePullPolicy: IfNotPresent
          ports:
            - name: discovery
              containerPort: 21027
              protocol: UDP
            - name: listen
              containerPort: 22000
              protocol: TCP
            - name: http
              containerPort: 8384
              protocol: TCP
          volumeMounts:
            - name: data
              mountPath: /var/syncthing
          livenessProbe:
            tcpSocket:
              port: 8384
            initialDelaySeconds: 0
            failureThreshold: 3
            timeoutSeconds: 1
            periodSeconds: 10
          readinessProbe:
            tcpSocket:
              port: 8384
            initialDelaySeconds: 0
            failureThreshold: 3
            timeoutSeconds: 1
            periodSeconds: 10
          startupProbe:
            tcpSocket:
              port: 8384
            initialDelaySeconds: 0
            failureThreshold: 30
            timeoutSeconds: 1
            periodSeconds: 5
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: syncthing-local-storage
