summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-06 00:03:13 +0300
committerPaul Buetow <paul@buetow.org>2025-08-06 00:03:13 +0300
commitfb683854a4ee23ee81a84fc746ae4878db40afdb (patch)
tree62f2129b08e7d0987da4246c72d04772b4c1fbaa
parent7557e5214752906a3585b4acaadd1c53256bbf4b (diff)
add syncthing
-rw-r--r--f3s/syncthing/Makefile12
-rw-r--r--f3s/syncthing/README.md20
-rw-r--r--f3s/syncthing/deployment.yaml33
-rw-r--r--f3s/syncthing/ingress.yaml20
-rw-r--r--f3s/syncthing/namespace.yaml4
-rw-r--r--f3s/syncthing/persistent-volume.yaml55
-rw-r--r--f3s/syncthing/service.yaml19
7 files changed, 163 insertions, 0 deletions
diff --git a/f3s/syncthing/Makefile b/f3s/syncthing/Makefile
new file mode 100644
index 0000000..a3b12c2
--- /dev/null
+++ b/f3s/syncthing/Makefile
@@ -0,0 +1,12 @@
+apply:
+ kubectl apply -f namespace.yaml
+ kubectl apply -f persistent-volume.yaml
+ kubectl apply -f service.yaml
+ kubectl apply -f deployment.yaml
+ kubectl apply -f ingress.yaml
+
+delete:
+ kubectl delete -f ingress.yaml
+ kubectl delete -f service.yaml
+ kubectl delete -f deployment.yaml
+ kubectl delete -f persistent-volume.yaml
diff --git a/f3s/syncthing/README.md b/f3s/syncthing/README.md
new file mode 100644
index 0000000..3e2344a
--- /dev/null
+++ b/f3s/syncthing/README.md
@@ -0,0 +1,20 @@
+# Syncthing Kubernetes Deployment
+
+This directory contains the Kubernetes configuration for deploying Syncthing.
+
+## Deployment
+
+To deploy Syncthing, apply the Kubernetes manifests in this directory:
+
+```bash
+make apply
+```
+
+## Configuration
+
+The deployment uses two persistent volumes:
+- `syncthing-config-pv`: for the syncthing configuration. Mapped to `/data/nfs/k3svolumes/syncthing/config` on the host.
+- `syncthing-data-pv`: for the syncthing data. Mapped to `/data/nfs/k3svolumes/syncthing/data` on the host.
+
+The web UI is available at http://syncthing.f3s.buetow.org.
+The data port is exposed on port 22000.
diff --git a/f3s/syncthing/deployment.yaml b/f3s/syncthing/deployment.yaml
new file mode 100644
index 0000000..9a85a17
--- /dev/null
+++ b/f3s/syncthing/deployment.yaml
@@ -0,0 +1,33 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: syncthing
+ namespace: services
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: syncthing
+ template:
+ metadata:
+ labels:
+ app: syncthing
+ spec:
+ containers:
+ - name: syncthing
+ image: lscr.io/linuxserver/syncthing:latest
+ ports:
+ - containerPort: 8384
+ - containerPort: 22000
+ volumeMounts:
+ - name: syncthing-config
+ mountPath: /config
+ - name: syncthing-data
+ mountPath: /data
+ volumes:
+ - name: syncthing-config
+ persistentVolumeClaim:
+ claimName: syncthing-config-pvc
+ - name: syncthing-data
+ persistentVolumeClaim:
+ claimName: syncthing-data-pvc
diff --git a/f3s/syncthing/ingress.yaml b/f3s/syncthing/ingress.yaml
new file mode 100644
index 0000000..b1e68e1
--- /dev/null
+++ b/f3s/syncthing/ingress.yaml
@@ -0,0 +1,20 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: syncthing-ingress
+ namespace: services
+ annotations:
+ spec.ingressClassName: traefik
+ traefik.ingress.kubernetes.io/router.entrypoints: web
+spec:
+ rules:
+ - host: syncthing.f3s.buetow.org
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: syncthing-service
+ port:
+ number: 8384
diff --git a/f3s/syncthing/namespace.yaml b/f3s/syncthing/namespace.yaml
new file mode 100644
index 0000000..da390d0
--- /dev/null
+++ b/f3s/syncthing/namespace.yaml
@@ -0,0 +1,4 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: services
diff --git a/f3s/syncthing/persistent-volume.yaml b/f3s/syncthing/persistent-volume.yaml
new file mode 100644
index 0000000..793ae60
--- /dev/null
+++ b/f3s/syncthing/persistent-volume.yaml
@@ -0,0 +1,55 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: syncthing-config-pv
+spec:
+ capacity:
+ storage: 1Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ hostPath:
+ path: /data/nfs/k3svolumes/syncthing/config
+ type: Directory
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: syncthing-config-pvc
+ namespace: services
+spec:
+ storageClassName: ""
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 1Gi
+---
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: syncthing-data-pv
+spec:
+ capacity:
+ storage: 300Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ hostPath:
+ path: /data/nfs/k3svolumes/syncthing/data
+ type: Directory
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: syncthing-data-pvc
+ namespace: services
+spec:
+ storageClassName: ""
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 300Gi \ No newline at end of file
diff --git a/f3s/syncthing/service.yaml b/f3s/syncthing/service.yaml
new file mode 100644
index 0000000..74bf5ed
--- /dev/null
+++ b/f3s/syncthing/service.yaml
@@ -0,0 +1,19 @@
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: syncthing
+ name: syncthing-service
+ namespace: services
+spec:
+ ports:
+ - name: web
+ port: 8384
+ protocol: TCP
+ targetPort: 8384
+ - name: data
+ port: 22000
+ protocol: TCP
+ targetPort: 22000
+ selector:
+ app: syncthing