removed configmap, added initcontainer

This commit is contained in:
2026-01-09 07:50:31 +01:00
parent fc9f85dd1d
commit 25e9f26aab
+27 -33
View File
@@ -100,30 +100,6 @@ spec:
requests:
storage: 100Mi
---
# ConfigMap for FileBrowser settings
apiVersion: v1
kind: ConfigMap
metadata:
name: filebrowser-config
namespace: web-system
labels:
app.kubernetes.io/instance: filebrowser
app.kubernetes.io/name: filebrowser
data:
.filebrowser.json: |
{
"port": 80,
"baseURL": "",
"address": "",
"log": "stdout",
"database": "/config/filebrowser.db",
"root": "/srv",
"auth": {
"method": "proxy",
"header": "X-authentik-username"
}
}
---
# FileBrowser Deployment
apiVersion: apps/v1
kind: Deployment
@@ -151,16 +127,40 @@ spec:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
initContainers:
# Configure proxy auth in database before starting
- name: configure-auth
image: filebrowser/filebrowser:v2.53.1
command:
- sh
- -c
- |
# Create database if it doesn't exist and configure proxy auth
if [ ! -f /config/filebrowser.db ]; then
echo "Creating new database with proxy auth..."
filebrowser config init --database /config/filebrowser.db
fi
echo "Setting proxy authentication..."
filebrowser config set --database /config/filebrowser.db --auth.method=proxy --auth.header=X-authentik-username
echo "Configuration complete"
volumeMounts:
- name: config
mountPath: /config
securityContext:
runAsUser: 1000
runAsGroup: 1000
containers:
- name: filebrowser
image: filebrowser/filebrowser:v2.53.1
command:
- filebrowser
- --database=/config/filebrowser.db
- --root=/srv
- --port=80
ports:
- containerPort: 80
name: http
protocol: TCP
args:
- --auth.method=proxy
- --auth.header=X-authentik-username
env:
- name: TZ
value: "Europe/Budapest"
@@ -169,9 +169,6 @@ spec:
mountPath: /srv
- name: config
mountPath: /config
- name: settings
mountPath: /.filebrowser.json
subPath: .filebrowser.json
resources:
requests:
cpu: 10m
@@ -202,9 +199,6 @@ spec:
- name: config
persistentVolumeClaim:
claimName: filebrowser-config
- name: settings
configMap:
name: filebrowser-config
---
# Service for FileBrowser
apiVersion: v1