diff options
| author | Paul Buetow <paul@buetow.org> | 2025-11-22 16:13:28 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-11-22 16:13:28 +0200 |
| commit | 589db6bab74a7ba582f873fef3ffee72aa59ccbe (patch) | |
| tree | bc0946cf62423a0985f40ef62d25b29a8ea40cdf | |
| parent | 0cc70a4b09404973448df9ccb836f4a408f565b3 (diff) | |
add filebrowser
| -rw-r--r-- | f3s/filebrowser/Justfile | 16 | ||||
| -rw-r--r-- | f3s/filebrowser/README.md | 51 | ||||
| -rw-r--r-- | f3s/filebrowser/helm-chart/Chart.yaml | 5 | ||||
| -rw-r--r-- | f3s/filebrowser/helm-chart/templates/deployment.yaml | 44 | ||||
| -rw-r--r-- | f3s/filebrowser/helm-chart/templates/ingress.yaml | 20 | ||||
| -rw-r--r-- | f3s/filebrowser/helm-chart/templates/persistent-volume.yaml | 83 | ||||
| -rw-r--r-- | f3s/filebrowser/helm-chart/templates/service.yaml | 15 | ||||
| -rw-r--r-- | frontends/Rexfile | 2 |
8 files changed, 235 insertions, 1 deletions
diff --git a/f3s/filebrowser/Justfile b/f3s/filebrowser/Justfile new file mode 100644 index 0000000..2479d83 --- /dev/null +++ b/f3s/filebrowser/Justfile @@ -0,0 +1,16 @@ +NAMESPACE := "services" +RELEASE_NAME := "filebrowser" +CHART_PATH := "./helm-chart" + +install: + helm install {{RELEASE_NAME}} {{CHART_PATH}} --namespace {{NAMESPACE}} --create-namespace + +upgrade: + helm upgrade {{RELEASE_NAME}} {{CHART_PATH}} --namespace {{NAMESPACE}} + +delete: + helm uninstall {{RELEASE_NAME}} --namespace {{NAMESPACE}} + kubectl delete pvc filebrowser-data-pvc filebrowser-database-pvc filebrowser-config-pvc -n {{NAMESPACE}} --ignore-not-found + kubectl delete pv filebrowser-data-pv filebrowser-database-pv filebrowser-config-pv --ignore-not-found + +deinstall: delete diff --git a/f3s/filebrowser/README.md b/f3s/filebrowser/README.md new file mode 100644 index 0000000..bace5b1 --- /dev/null +++ b/f3s/filebrowser/README.md @@ -0,0 +1,51 @@ + +# File Browser Kubernetes Deployment + +This directory contains the Kubernetes configuration for deploying File Browser to a k3s cluster. + +## Deployment + +To deploy File Browser, use the Justfile commands: + +```bash +just install +``` + +## Prerequisites + +Before deploying, ensure the following are set up: + +### 1. Create Persistent Volume Directories + +The deployment requires three persistent volumes. Create the directories on the k3s node: + +```bash +mkdir -p /data/nfs/k3svolumes/filebrowser/data +mkdir -p /data/nfs/k3svolumes/filebrowser/database +mkdir -p /data/nfs/k3svolumes/filebrowser/config +chown -R 1000:1000 /data/nfs/k3svolumes/filebrowser/ +chmod -R 775 /data/nfs/k3svolumes/filebrowser/ +``` + +## Configuration + +File Browser will be accessible at: `http://filebrowser.f3s.buetow.org` + +Default credentials: +- Username: `admin` +- Password: `admin` + +**Important:** Change the default password after first login! + +## Storage + +The deployment uses three persistent volumes on NFS: +- **data** (50Gi): Stores files that can be browsed and managed +- **database** (1Gi): Stores the File Browser database +- **config** (1Gi): Stores configuration files + +## Justfile Commands + +- `just install` - Install File Browser using Helm +- `just upgrade` - Upgrade the File Browser deployment +- `just delete` - Uninstall File Browser from the cluster diff --git a/f3s/filebrowser/helm-chart/Chart.yaml b/f3s/filebrowser/helm-chart/Chart.yaml new file mode 100644 index 0000000..62fd97a --- /dev/null +++ b/f3s/filebrowser/helm-chart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: filebrowser +description: A Helm chart for deploying File Browser +version: 0.1.0 +appVersion: "latest" diff --git a/f3s/filebrowser/helm-chart/templates/deployment.yaml b/f3s/filebrowser/helm-chart/templates/deployment.yaml new file mode 100644 index 0000000..b0d5270 --- /dev/null +++ b/f3s/filebrowser/helm-chart/templates/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: filebrowser + namespace: services +spec: + replicas: 1 + selector: + matchLabels: + app: filebrowser + template: + metadata: + labels: + app: filebrowser + spec: + securityContext: + fsGroup: 1000 + containers: + - name: filebrowser + image: filebrowser/filebrowser:latest + ports: + - containerPort: 80 + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + volumeMounts: + - name: filebrowser-data + mountPath: /srv + - name: filebrowser-database + mountPath: /database + - name: filebrowser-config + mountPath: /config + volumes: + - name: filebrowser-data + persistentVolumeClaim: + claimName: filebrowser-data-pvc + - name: filebrowser-database + persistentVolumeClaim: + claimName: filebrowser-database-pvc + - name: filebrowser-config + persistentVolumeClaim: + claimName: filebrowser-config-pvc diff --git a/f3s/filebrowser/helm-chart/templates/ingress.yaml b/f3s/filebrowser/helm-chart/templates/ingress.yaml new file mode 100644 index 0000000..4623501 --- /dev/null +++ b/f3s/filebrowser/helm-chart/templates/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: filebrowser-ingress + namespace: services + annotations: + spec.ingressClassName: traefik + traefik.ingress.kubernetes.io/router.entrypoints: web +spec: + rules: + - host: filebrowser.f3s.buetow.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: filebrowser-service + port: + number: 80 diff --git a/f3s/filebrowser/helm-chart/templates/persistent-volume.yaml b/f3s/filebrowser/helm-chart/templates/persistent-volume.yaml new file mode 100644 index 0000000..d65d309 --- /dev/null +++ b/f3s/filebrowser/helm-chart/templates/persistent-volume.yaml @@ -0,0 +1,83 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: filebrowser-data-pv +spec: + capacity: + storage: 50Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: /data/nfs/k3svolumes/filebrowser/data + type: Directory +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: filebrowser-database-pv +spec: + capacity: + storage: 1Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: /data/nfs/k3svolumes/filebrowser/database + type: Directory +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: filebrowser-config-pv +spec: + capacity: + storage: 1Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: /data/nfs/k3svolumes/filebrowser/config + type: Directory +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: filebrowser-data-pvc + namespace: services +spec: + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 50Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: filebrowser-database-pvc + namespace: services +spec: + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: filebrowser-config-pvc + namespace: services +spec: + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/f3s/filebrowser/helm-chart/templates/service.yaml b/f3s/filebrowser/helm-chart/templates/service.yaml new file mode 100644 index 0000000..c30c811 --- /dev/null +++ b/f3s/filebrowser/helm-chart/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: filebrowser + name: filebrowser-service + namespace: services +spec: + ports: + - name: web + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: filebrowser diff --git a/frontends/Rexfile b/frontends/Rexfile index 6cc91d3..95e788a 100644 --- a/frontends/Rexfile +++ b/frontends/Rexfile @@ -77,7 +77,7 @@ our @dns_zones_remove = qw//; # k3s cluster running on FreeBSD in my LAN our @f3s_hosts = - qw/f3s.buetow.org anki.f3s.buetow.org bag.f3s.buetow.org flux.f3s.buetow.org audiobookshelf.f3s.buetow.org grafana.f3s.buetow.org radicale.f3s.buetow.org vault.f3s.buetow.org syncthing.f3s.buetow.org uprecords.f3s.buetow.org koreader.f3s.buetow.org filerise.f3s.buetow.org/; + qw/f3s.buetow.org anki.f3s.buetow.org bag.f3s.buetow.org flux.f3s.buetow.org audiobookshelf.f3s.buetow.org grafana.f3s.buetow.org radicale.f3s.buetow.org vault.f3s.buetow.org syncthing.f3s.buetow.org uprecords.f3s.buetow.org koreader.f3s.buetow.org filebrowser.f3s.buetow.org/; # optionally, only enable manually for temp time, as no password protection yet # push @f3s_hosts, 'registry.f3s.buetow.org'; |
