diff --git a/deployments/home-server/kustomization.yaml b/deployments/home-server/kustomization.yaml index d79fffc..8f8a6f6 100644 --- a/deployments/home-server/kustomization.yaml +++ b/deployments/home-server/kustomization.yaml @@ -5,6 +5,7 @@ kind: Kustomization resources: - authentik.yaml - nextcloud.yaml + - syncthing.yaml - vaultwarden.yaml - linkwarden.yaml - dovecot.yaml diff --git a/deployments/home-server/syncthing.yaml b/deployments/home-server/syncthing.yaml new file mode 100644 index 0000000..21ee4a2 --- /dev/null +++ b/deployments/home-server/syncthing.yaml @@ -0,0 +1,111 @@ +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: syncthing-pv +spec: + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: local-path + hostPath: + path: /dpool/temp/Syncthing +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: syncthing-pvc + namespace: home-server +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: 5Gi + volumeName: syncthing-pv +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: syncthing + namespace: home-server +spec: + replicas: 1 + selector: + matchLabels: + app: syncthing + template: + metadata: + labels: + app: syncthing + spec: + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + containers: + - name: syncthing + image: syncthing/syncthing:latest + ports: + - containerPort: 8384 + name: web + - containerPort: 22000 + name: sync-tcp + protocol: TCP + - containerPort: 22000 + name: sync-udp + protocol: UDP + - containerPort: 21027 + name: discovery + protocol: UDP + volumeMounts: + - name: syncthing-data + mountPath: /var/syncthing + env: + - name: STGUIADDRESS + value: "0.0.0.0:8384" + volumes: + - name: syncthing-data + persistentVolumeClaim: + claimName: syncthing-pvc +--- +apiVersion: v1 +kind: Service +metadata: + name: syncthing + namespace: home-server +spec: + selector: + app: syncthing + ports: + - port: 8384 + name: web + targetPort: 8384 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: syncthing + namespace: home-server + annotations: + external-dns.alpha.kubernetes.io/hostname: syncthing.hxme.net + nginx.ingress.kubernetes.io/backend-protocol: "HTTP" + nginx.ingress.kubernetes.io/ssl-redirect: "true" +spec: + tls: + - hosts: + - syncthing.hxme.net + secretName: wildcard-hxme-net + rules: + - host: syncthing.hxme.net + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: syncthing + port: + number: 8384 +