blob: b3bb4bb064aab8b6ed290c86efc9c3cff2f316d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
apiVersion: apps/v1
kind: Deployment
metadata:
name: filebrowser
namespace: services
spec:
replicas: 1
# Recreate so the old pod fully terminates before the new one starts —
# avoids NFS-lock races on the hostPath-backed PVC during rolling updates.
strategy:
type: Recreate
selector:
matchLabels:
app: filebrowser
template:
metadata:
labels:
app: filebrowser
spec:
initContainers:
- name: nfs-check-data
image: busybox:stable
command:
- sh
- -c
- |
test -f /mnt/.nfs-sentinel || (
echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
echo "refusing to start; node likely has NFS unmounted"
echo "pod would otherwise bind-mount the local-XFS shadow"
exit 1
)
volumeMounts:
- name: filebrowser-data
mountPath: /mnt
readOnly: true
- name: nfs-check-database
image: busybox:stable
command:
- sh
- -c
- |
test -f /mnt/.nfs-sentinel || (
echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
echo "refusing to start; node likely has NFS unmounted"
echo "pod would otherwise bind-mount the local-XFS shadow"
exit 1
)
volumeMounts:
- name: filebrowser-database
mountPath: /mnt
readOnly: true
- name: nfs-check-config
image: busybox:stable
command:
- sh
- -c
- |
test -f /mnt/.nfs-sentinel || (
echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
echo "refusing to start; node likely has NFS unmounted"
echo "pod would otherwise bind-mount the local-XFS shadow"
exit 1
)
volumeMounts:
- name: filebrowser-config
mountPath: /mnt
readOnly: true
securityContext:
runAsUser: 65534
runAsGroup: 65534
fsGroup: 65534
containers:
- name: filebrowser
image: filebrowser/filebrowser:latest
ports:
- containerPort: 80
env:
- name: PUID
value: "65534"
- name: PGID
value: "65534"
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
|