@@ -34,17 +34,38 @@ spec:
3434 name : " ${APP}"
3535 globalMounts :
3636 - path : /config
37- containers :
38- app :
39- image :
37+ initContainers :
38+ # Copy the GitOps-managed config into the writable /config PVC.
39+ init-config :
40+ image : &image
4041 repository : ghcr.io/blakeblackshear/frigate
4142 tag : 0.17.2
4243 pullPolicy : IfNotPresent
44+ command :
45+ - /bin/bash
46+ - -c
47+ - cp -f /tmp/frigate-config/config.yml /config/config.yml
48+ # Seed a writable copy of nginx's tree so the non-root user can
49+ # write runtime/log/temp files under /usr/local/nginx.
50+ init-nginx :
51+ image : *image
52+ command :
53+ - /bin/bash
54+ - -c
55+ - cp -Rf /usr/local/nginx/. /nginx/
56+ containers :
57+ app :
58+ image : *image
4359 envFrom :
4460 - secretRef :
4561 name : frigate
4662 env :
4763 TZ : America/New_York
64+ # Non-root (s6-overlay) plumbing — see s6-* override scripts.
65+ HOME : /tmp/home
66+ USER : &uid "1026"
67+ S6_CATCHALL_USER : *uid
68+ S6_YES_I_WANT_A_WORLD_WRITABLE_RUN_BECAUSE_KUBERNETES : " 1"
4869 probes :
4970 liveness : &probes
5071 enabled : true
6788 port : *port
6889 failureThreshold : 30
6990 periodSeconds : 10
91+ securityContext :
92+ allowPrivilegeEscalation : false
93+ capabilities :
94+ drop :
95+ - ALL
7096 resources :
7197 requests :
7298 gpu.intel.com/i915 : 1
@@ -77,7 +103,18 @@ spec:
77103 memory : 4Gi
78104 defaultPodOptions :
79105 automountServiceAccountToken : false
80- # hostUsers: false
106+ # Run as the NAS-owning user (1026:100) — matching the arr apps — so
107+ # Frigate writes recordings to NFS under standard root_squash instead
108+ # of running as root. Frigate's s6-overlay image needs the s6-* script
109+ # overrides + HOME/S6_* env + writable /run,/usr/local/nginx,/tmp/home.
110+ securityContext :
111+ runAsUser : 1026
112+ runAsGroup : &gid 100
113+ fsGroup : *gid
114+ fsGroupChangePolicy : OnRootMismatch
115+ runAsNonRoot : true
116+ seccompProfile :
117+ type : RuntimeDefault
81118 service :
82119 app :
83120 controller : frigate
@@ -105,8 +142,19 @@ spec:
105142 type : configMap
106143 name : frigate-configmap
107144 globalMounts :
108- - path : /config/config.yml
109- subPath : config.yml
145+ - path : /tmp/frigate-config
146+ readOnly : true
147+ # s6-overlay override scripts (executable) for non-root operation.
148+ s6-scripts :
149+ type : configMap
150+ name : frigate-s6-scripts
151+ defaultMode : 0555
152+ globalMounts :
153+ - path : /etc/s6-overlay/s6-rc.d/log-prepare/run
154+ subPath : run
155+ readOnly : true
156+ - path : /package/admin/s6/command/s6-applyuidgid
157+ subPath : s6-applyuidgid
110158 readOnly : true
111159 media :
112160 type : nfs
@@ -126,3 +174,25 @@ spec:
126174 sizeLimit : 512Mi
127175 globalMounts :
128176 - path : /dev/shm
177+ # Writable dirs the non-root user needs (stock image expects root here).
178+ run :
179+ type : emptyDir
180+ medium : Memory
181+ globalMounts :
182+ - path : /run
183+ home :
184+ type : emptyDir
185+ globalMounts :
186+ - path : /tmp/home
187+ letsencrypt :
188+ type : emptyDir
189+ globalMounts :
190+ - path : /etc/letsencrypt
191+ nginx :
192+ type : emptyDir
193+ advancedMounts :
194+ frigate :
195+ init-nginx :
196+ - path : /nginx
197+ app :
198+ - path : /usr/local/nginx
0 commit comments