From 898bd1062128af0da35a62c2eb3e436d0cea229d Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Thu, 13 Nov 2025 19:57:13 -0600 Subject: [PATCH] add backrest --- .../cl01tl/applications/homepage/values.yaml | 6 ++ clusters/cl01tl/services/blocky/values.yaml | 1 + clusters/cl01tl/storage/backrest/Chart.yaml | 21 +++++ .../backrest/templates/http-route.yaml | 28 +++++++ .../templates/persistent-volume-claim.yaml | 17 ++++ .../backrest/templates/persistent-volume.yaml | 23 ++++++ clusters/cl01tl/storage/backrest/values.yaml | 77 +++++++++++++++++++ hosts/ps08rp/blocky/config.yml | 1 + hosts/ps09rp/blocky/config.yml | 1 + 9 files changed, 175 insertions(+) create mode 100644 clusters/cl01tl/storage/backrest/Chart.yaml create mode 100644 clusters/cl01tl/storage/backrest/templates/http-route.yaml create mode 100644 clusters/cl01tl/storage/backrest/templates/persistent-volume-claim.yaml create mode 100644 clusters/cl01tl/storage/backrest/templates/persistent-volume.yaml create mode 100644 clusters/cl01tl/storage/backrest/values.yaml diff --git a/clusters/cl01tl/applications/homepage/values.yaml b/clusters/cl01tl/applications/homepage/values.yaml index 75f611628..506f3d635 100644 --- a/clusters/cl01tl/applications/homepage/values.yaml +++ b/clusters/cl01tl/applications/homepage/values.yaml @@ -522,6 +522,12 @@ homepage: href: https://vault.alexlebens.net siteMonitor: http://vault.vault:8200 statusStyle: dot + - Backups: + icon: sh-backrest.webp + description: Backrest + href: https://backrest.alexlebens.net + siteMonitor: http://backrest.backrest:80 + statusStyle: dot - TV Shows: - Sonarr: icon: sh-sonarr.webp diff --git a/clusters/cl01tl/services/blocky/values.yaml b/clusters/cl01tl/services/blocky/values.yaml index 4c8806bde..9130e448b 100644 --- a/clusters/cl01tl/services/blocky/values.yaml +++ b/clusters/cl01tl/services/blocky/values.yaml @@ -109,6 +109,7 @@ blocky: argocd IN CNAME traefik-cl01tl audiobookshelf IN CNAME traefik-cl01tl authentik IN CNAME traefik-cl01tl + backrest IN CNAME traefik-cl01tl bazarr IN CNAME traefik-cl01tl calibre IN CNAME traefik-cl01tl calibre-downloader IN CNAME traefik-cl01tl diff --git a/clusters/cl01tl/storage/backrest/Chart.yaml b/clusters/cl01tl/storage/backrest/Chart.yaml new file mode 100644 index 000000000..48c964514 --- /dev/null +++ b/clusters/cl01tl/storage/backrest/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: backrest +version: 1.0.0 +description: backrest +keywords: + - backrest + - backup +home: https://wiki.alexlebens.dev/ +sources: + - https://github.com/garethgeorge/backrest + - https://hub.docker.com/r/garethgeorge/backrest + - https://github.com/bjw-s-labs/helm-charts/tree/main/charts/other/app-template +maintainers: + - name: alexlebens +dependencies: + - name: app-template + alias: backrest + repository: https://bjw-s-labs.github.io/helm-charts/ + version: 4.4.0 +icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/backrest.png +appVersion: v1.10.1 diff --git a/clusters/cl01tl/storage/backrest/templates/http-route.yaml b/clusters/cl01tl/storage/backrest/templates/http-route.yaml new file mode 100644 index 000000000..767030b4f --- /dev/null +++ b/clusters/cl01tl/storage/backrest/templates/http-route.yaml @@ -0,0 +1,28 @@ +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: http-route-backrest + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: http-route-backrest + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: traefik-gateway + namespace: traefik + hostnames: + - backrest.alexlebens.net + rules: + - matches: + - path: + type: PathPrefix + value: / + backendRefs: + - group: '' + kind: Service + name: backrest + port: 80 + weight: 100 diff --git a/clusters/cl01tl/storage/backrest/templates/persistent-volume-claim.yaml b/clusters/cl01tl/storage/backrest/templates/persistent-volume-claim.yaml new file mode 100644 index 000000000..641addea8 --- /dev/null +++ b/clusters/cl01tl/storage/backrest/templates/persistent-volume-claim.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: backrest-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: backrest-nfs-storage + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + volumeName: backrest-nfs-storage + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi diff --git a/clusters/cl01tl/storage/backrest/templates/persistent-volume.yaml b/clusters/cl01tl/storage/backrest/templates/persistent-volume.yaml new file mode 100644 index 000000000..5eed5a019 --- /dev/null +++ b/clusters/cl01tl/storage/backrest/templates/persistent-volume.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: backrest-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: backrest-nfs-storage + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs-client + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + nfs: + path: /volume2/Storage + server: synologybond.alexlebens.net + mountOptions: + - vers=4 + - minorversion=1 + - noac diff --git a/clusters/cl01tl/storage/backrest/values.yaml b/clusters/cl01tl/storage/backrest/values.yaml new file mode 100644 index 000000000..0d3a31466 --- /dev/null +++ b/clusters/cl01tl/storage/backrest/values.yaml @@ -0,0 +1,77 @@ +backrest: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + containers: + main: + image: + repository: garethgeorge/backrest + tag: v1.10.1 + pullPolicy: IfNotPresent + env: + - name: TZ + value: America/Chicago + - name: BACKREST_DATA + value: /data + - name: BACKREST_CONFIG + value: /config/config.json + - name: XDG_CACHE_HOME + value: /cache + - name: TMPDIR + value: /tmp + resources: + requests: + cpu: 10m + memory: 256Mi + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 9898 + protocol: TCP + persistence: + data: + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 10Gi + retain: true + advancedMounts: + main: + main: + - path: /data + readOnly: false + config: + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 1Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false + cache: + type: emptyDir + advancedMounts: + main: + main: + - path: /cache + readOnly: false + tmp: + type: emptyDir + advancedMounts: + main: + main: + - path: /tmp + readOnly: false + storage: + existingClaim: backrest-nfs-storage + advancedMounts: + main: + main: + - path: /userdata + readOnly: true diff --git a/hosts/ps08rp/blocky/config.yml b/hosts/ps08rp/blocky/config.yml index d1811f8fa..044bebae2 100644 --- a/hosts/ps08rp/blocky/config.yml +++ b/hosts/ps08rp/blocky/config.yml @@ -85,6 +85,7 @@ customDNS: argocd IN CNAME traefik-cl01tl audiobookshelf IN CNAME traefik-cl01tl authentik IN CNAME traefik-cl01tl + backrest IN CNAME traefik-cl01tl bazarr IN CNAME traefik-cl01tl calibre IN CNAME traefik-cl01tl calibre-downloader IN CNAME traefik-cl01tl diff --git a/hosts/ps09rp/blocky/config.yml b/hosts/ps09rp/blocky/config.yml index d1811f8fa..044bebae2 100644 --- a/hosts/ps09rp/blocky/config.yml +++ b/hosts/ps09rp/blocky/config.yml @@ -85,6 +85,7 @@ customDNS: argocd IN CNAME traefik-cl01tl audiobookshelf IN CNAME traefik-cl01tl authentik IN CNAME traefik-cl01tl + backrest IN CNAME traefik-cl01tl bazarr IN CNAME traefik-cl01tl calibre IN CNAME traefik-cl01tl calibre-downloader IN CNAME traefik-cl01tl