Refactor Syncthing

This commit is contained in:
Danny Bessems 2023-01-07 13:34:36 +01:00
parent 93612623e4
commit e0c77a2913
5 changed files with 56 additions and 52 deletions

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: syncthing

View File

@ -1,30 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: syncthing
spec:
ports:
- protocol: TCP
name: web
port: 8384
- protocol: TCP
name: tcp-file-xfer
port: 22000
- protocol: UDP
name: quic-file-xfer
port: 22000
- protocol: UDP
name: discovery
port: 21027
selector:
app: syncthing
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:
app: syncthing app: syncthing
name: syncthing name: syncthing
namespace: syncthing
spec: spec:
replicas: 1 replicas: 1
strategy: strategy:
@ -64,34 +44,3 @@ spec:
- name: longhorn-syncthing-data - name: longhorn-syncthing-data
persistentVolumeClaim: persistentVolumeClaim:
claimName: longhorn-syncthing-data claimName: longhorn-syncthing-data
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: syncthing
spec:
entryPoints:
- websecure
routes:
- match: Host(`sync.spamasaurus.com`)
kind: Rule
services:
- name: syncthing
port: 8384
middlewares:
- name: 2fa-authentication@file
- name: security-headers@file
- name: compression@file
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: longhorn-syncthing-data
namespace: default
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 5Gi

View File

@ -0,0 +1,18 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: syncthing
namespace: syncthing
spec:
entryPoints:
- websecure
routes:
- match: Host(`sync.spamasaurus.com`)
kind: Rule
services:
- name: syncthing
port: 8384
middlewares:
- name: 2fa-authentication@file
- name: security-headers@file
- name: compression@file

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: longhorn-syncthing-data
namespace: syncthing
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 5Gi

View File

@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: syncthing
namespace: syncthing
spec:
ports:
- protocol: TCP
name: web
port: 8384
- protocol: TCP
name: tcp-file-xfer
port: 22000
- protocol: UDP
name: quic-file-xfer
port: 22000
- protocol: UDP
name: discovery
port: 21027
selector:
app: syncthing