From bd5fab7419099d1c32baa20b42d879b4182a85a3 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Tue, 22 Sep 2026 00:30:42 +0200 Subject: [PATCH] syncthing(kube): deploy --- kubernetes/kustomization.yaml | 1 + .../personal/syncthing/kustomization.yaml | 13 ++ .../personal/syncthing/kustomizeconfig.yaml | 6 + kubernetes/personal/syncthing/namespace.yaml | 7 + kubernetes/personal/syncthing/release.yaml | 19 +++ kubernetes/personal/syncthing/repository.yaml | 8 + kubernetes/personal/syncthing/values.yaml | 152 ++++++++++++++++++ kubernetes/system/cilium/pool.yaml | 1 + 8 files changed, 207 insertions(+) create mode 100644 kubernetes/personal/syncthing/kustomization.yaml create mode 100644 kubernetes/personal/syncthing/kustomizeconfig.yaml create mode 100644 kubernetes/personal/syncthing/namespace.yaml create mode 100644 kubernetes/personal/syncthing/release.yaml create mode 100644 kubernetes/personal/syncthing/repository.yaml create mode 100644 kubernetes/personal/syncthing/values.yaml diff --git a/kubernetes/kustomization.yaml b/kubernetes/kustomization.yaml index 83f1051..b72a2cb 100644 --- a/kubernetes/kustomization.yaml +++ b/kubernetes/kustomization.yaml @@ -35,6 +35,7 @@ resources: # Personal (apps storing my own content, grouped by content type) - personal/paperless - personal/radicale + - personal/syncthing - personal/media/photoprism - personal/notes/notesnook - personal/notes/obsidian-livesync diff --git a/kubernetes/personal/syncthing/kustomization.yaml b/kubernetes/personal/syncthing/kustomization.yaml new file mode 100644 index 0000000..58567ba --- /dev/null +++ b/kubernetes/personal/syncthing/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: syncthing +resources: + - namespace.yaml + - repository.yaml + - release.yaml +secretGenerator: + - name: syncthing-values + files: + - values.yaml=values.yaml +configurations: + - kustomizeconfig.yaml diff --git a/kubernetes/personal/syncthing/kustomizeconfig.yaml b/kubernetes/personal/syncthing/kustomizeconfig.yaml new file mode 100644 index 0000000..4ea8252 --- /dev/null +++ b/kubernetes/personal/syncthing/kustomizeconfig.yaml @@ -0,0 +1,6 @@ +nameReference: + - kind: Secret + version: v1 + fieldSpecs: + - path: spec/valuesFrom/name + kind: HelmRelease diff --git a/kubernetes/personal/syncthing/namespace.yaml b/kubernetes/personal/syncthing/namespace.yaml new file mode 100644 index 0000000..3cccc28 --- /dev/null +++ b/kubernetes/personal/syncthing/namespace.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: syncthing + labels: + app.kubernetes.io/name: syncthing + app.kubernetes.io/component: file-sync diff --git a/kubernetes/personal/syncthing/release.yaml b/kubernetes/personal/syncthing/release.yaml new file mode 100644 index 0000000..36101ea --- /dev/null +++ b/kubernetes/personal/syncthing/release.yaml @@ -0,0 +1,19 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: syncthing + namespace: syncthing +spec: + interval: 1m + chart: + spec: + sourceRef: + kind: HelmRepository + name: k8s-home-lab + namespace: syncthing + chart: syncthing + version: "5.2.0" + interval: 1m + valuesFrom: + - kind: Secret + name: syncthing-values diff --git a/kubernetes/personal/syncthing/repository.yaml b/kubernetes/personal/syncthing/repository.yaml new file mode 100644 index 0000000..a21a7b4 --- /dev/null +++ b/kubernetes/personal/syncthing/repository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: k8s-home-lab + namespace: syncthing +spec: + interval: 1h + url: https://k8s-home-lab.github.io/helm-charts/ diff --git a/kubernetes/personal/syncthing/values.yaml b/kubernetes/personal/syncthing/values.yaml new file mode 100644 index 0000000..cdbf579 --- /dev/null +++ b/kubernetes/personal/syncthing/values.yaml @@ -0,0 +1,152 @@ +# Syncthing continuous file synchronization +# +# Sync ports (22000 TCP+QUIC, 21027 UDP) are exposed through LoadBalancer +# services on the dedicated Cilium pool IP 10.2.2.7 (appended to +# kubernetes/system/cilium/pool.yaml). The GUI goes through Traefik like the +# other *.lan services. +controller: + replicas: 1 +image: + repository: syncthing/syncthing + tag: "2.1" +env: + - name: TZ + value: Europe/Paris + - name: PUID + value: "1000" + - name: PGID + value: "1000" +podSecurityContext: + fsGroup: 1000 +service: + main: + ports: + http: + port: 8384 + # Sync protocol and QUIC share 22000 on the pooled IP; LAN discovery + # rides on UDP 21027. externalTrafficPolicy Local preserves client IPs. + listen: + enabled: true + type: LoadBalancer + externalTrafficPolicy: Local + loadBalancerIP: 10.2.2.7 + ports: + listen: + enabled: true + port: 22000 + protocol: TCP + targetPort: 22000 + quic: + enabled: true + port: 22000 + protocol: UDP + targetPort: 22000 + discovery: + enabled: true + type: LoadBalancer + externalTrafficPolicy: Local + loadBalancerIP: 10.2.2.7 + ports: + discovery: + enabled: true + port: 21027 + protocol: UDP + targetPort: 21027 +probes: + liveness: + custom: true + spec: + httpGet: + path: /rest/noauth/health + port: http + readiness: + custom: true + spec: + httpGet: + path: /rest/noauth/health + port: http +ingress: + main: + enabled: true + ingressClassName: traefik + annotations: + external-dns.alpha.kubernetes.io/enabled: "true" + hosts: + - host: syncthing.lan + paths: + - path: / + pathType: Prefix +persistence: + config: + enabled: true + mountPath: /var/syncthing/config + storageClass: longhorn + size: 5Gi + # Shares are recreated by hand in the GUI after cutover — the instance + # boots with a fresh config (see plans/syncthing-docker-to-kube-migration.md): + # valentin's folders at /data/valentin/… and sarah's at /data/sarah/…, all + # backed by the same TrueNAS exports as the docker stack. Photoprism + # already mounts the valentin Photos export concurrently. + valentin-documents: + enabled: true + type: custom + mountPath: /data/valentin/Documents + volumeSpec: + nfs: + server: truenas.lan + path: /mnt/main_storage/valentin/Documents + valentin-photos: + enabled: true + type: custom + mountPath: /data/valentin/Photos + volumeSpec: + nfs: + server: truenas.lan + path: /mnt/main_storage/valentin/Photos + sarah-documents: + enabled: true + type: custom + mountPath: /data/sarah/Documents + volumeSpec: + nfs: + server: truenas.lan + path: /mnt/main_storage/sarah/Documents + sarah-photos: + enabled: true + type: custom + mountPath: /data/sarah/Photos + volumeSpec: + nfs: + server: truenas.lan + path: /mnt/main_storage/sarah/Photos +resources: + requests: + memory: 512Mi + limits: + memory: 2Gi +sops: + lastmodified: "2026-09-21T22:28:39Z" + mac: ENC[AES256_GCM,data:BR4P4s4C9n4bEHryqfHpzzFHxAlKeujFBO2Qhsc4qdkcI5dftJ7jrknWtW0uv1E2Aljp50Mx1Rk4wglaWh3MS/ZnY/1dUxCfKuXOGkv9+mymQxDk6zJLsUNTH7sMr5kzlVWfv3yzXF50HWuiNl71BAv4mtlrtarXS1KVQrCKNaA=,iv:aG9OxDOhwk7xYNbvESNMFnXIjKhbYNO0gvDn1a9QQvc=,tag:QxM3EX8V2KJzosRz5damrw==,type:str] + pgp: + - created_at: "2026-09-21T22:28:39Z" + enc: |- + -----BEGIN PGP MESSAGE----- + + hQIMA7uy4qQr71wiAQ//cvlMqPSaED2y5dsq8H/W/dqYVOeG7E/ZOuJGaYnImrrp + V2W6vPTzQ8QuYTKa1X4aOIlda04n7i2kDQCvpszmdpsU2y0SWtsgOBbyloIU3cAM + 69HGd1SNqP/FayeZy/hHNvvEjmsgKX/9IV1YBGOcikmd7MqoxgGRgIxXORzY0dBG + 7oREwV0HubdIBG6Fi6HUyN+Pugftpcumfwtl8ppPUYi1HGKzL5LzIT6gfqXtUcBg + 8Wl2f0kMZsat1e05sZZah41dg+BAlyDgCRFo/ZQIhzHi28rJkZWG2aZxQfvAFMYJ + hUkjVyN7rAO01b2PsXK3bleFjD8iL8PhHY/Rio0/Uizjub7inako2SUd38D7X+ce + M1c2GoDVNmwZyXg7jBzb67JxLPn4Ic1kbjUi/JJL22rDzN0pBf6J7ExCpVGxrwK8 + ++YDD1m/rY3YA8/ioM+pTu3ktEd1zu0T1yFySjgtvX8QVmOkrG1AA8E/N3+pzFWP + 9wrJJ+yp5CYQl9d3j5LQcOzmvROi0EHjeZY75IHw8NwkyWdnRgWFIPsXxVoSUhSk + 909RE//BuKSSRd1r9D/4w14Eb9KC74bIsUIflyK2Qs/N3rh9+/O8FS/5saryq7Er + GO3oAmFqC2F4Y6zFlmXkr43gBFjCPWl0DxI3uUK/gcw8kBpLSJex3j2sDaLViS/S + XgFsDLAjHnEo5DC+xyJQI5xMWsQzx/ASNZdBVLrnYPsRt+YG7qfu3lKNS9ujAG7K + ti58fACtT97K8IrUMNyEDGieFz65TYPcie4qILnDt2Hkr6QUEdBR8rvn/8z36D8= + =47Rw + -----END PGP MESSAGE----- + fp: DC6910268E657FF70BA7EC289974494E76938DDC + encrypted_regex: ^(data|stringData|.*key|.*crt)$ + version: 3.10.2 diff --git a/kubernetes/system/cilium/pool.yaml b/kubernetes/system/cilium/pool.yaml index e00b27c..ff378c4 100644 --- a/kubernetes/system/cilium/pool.yaml +++ b/kubernetes/system/cilium/pool.yaml @@ -8,3 +8,4 @@ spec: - cidr: "10.2.2.4/32" - cidr: "10.2.2.5/32" - cidr: "10.2.2.6/32" + - cidr: "10.2.2.7/32"