Initial containerized Frigate camera control bridge

This commit is contained in:
2026-08-03 00:21:18 +02:00
commit 26e042d2d7
15 changed files with 2466 additions and 0 deletions
+86
View File
@@ -0,0 +1,86 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frigate-with-camera-control
spec:
replicas: 1
selector:
matchLabels:
app: frigate
template:
metadata:
labels:
app: frigate
spec:
containers:
- name: frigate
image: ghcr.io/blakeblackshear/frigate:stable
ports:
- name: http
containerPort: 5000
- name: camera-control
image: registry.example.local/frigate-camera-control-bridge:1.0
env:
- name: FRIGATE_NAME
value: frigate-main
- name: FRIGATE_URL
value: http://127.0.0.1:5000
- name: MQTT_HOST
value: mqtt.default.svc.cluster.local
- name: BASE_TOPIC
value: frigate_camera_control/frigate-main
- name: UI_LANGUAGE
value: en
- name: SNAPSHOT_RETRY_SECONDS
value: "600"
- name: SNAPSHOT_REFRESH_SECONDS
value: "3600"
- name: SNAPSHOT_LIVE_ON_GUI
value: "true"
- name: MQTT_USER
valueFrom:
secretKeyRef:
name: frigate-camera-control
key: mqtt-user
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
name: frigate-camera-control
key: mqtt-password
- name: DEFAULT_CAMERA_USER
valueFrom:
secretKeyRef:
name: frigate-camera-control
key: camera-user
- name: DEFAULT_CAMERA_PASSWORD
valueFrom:
secretKeyRef:
name: frigate-camera-control
key: camera-password
- name: HTTP_TOKEN
valueFrom:
secretKeyRef:
name: frigate-camera-control
key: http-token
optional: true
ports:
- name: control-http
containerPort: 5011
readinessProbe:
httpGet:
path: /readyz
port: control-http
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: control-http
initialDelaySeconds: 20
periodSeconds: 30
volumeMounts:
- name: camera-control-state
mountPath: /var/lib/frigate-camera-control-bridge
volumes:
- name: camera-control-state
emptyDir: {}
+57
View File
@@ -0,0 +1,57 @@
# Podman Quadlet Example
## PL
To jest generyczny przyklad uruchomienia kontenera
`frigate-camera-control-bridge` przez Podman Quadlet. Pliki sa przykladem dla
jednej instancji Frigate. Dla wielu instancji skopiuj `.container` oraz `.env`
i zmien `FRIGATE_NAME`, `FRIGATE_URL`, `BASE_TOPIC`, port publikowany przez
`PublishPort` oraz credentiale MQTT.
Przykladowa instalacja:
```bash
install -d /etc/frigate-camera-control-bridge
install -m 0600 frigate-camera-control-bridge.env.example \
/etc/frigate-camera-control-bridge/frigate-main.env
install -m 0644 frigate-camera-control-bridge.container \
/etc/containers/systemd/frigate-camera-control-bridge.container
systemctl daemon-reload
systemctl enable --now frigate-camera-control-bridge.service
```
W pliku env uzupelnij:
- `MQTT_HOST`, `MQTT_USER`, `MQTT_PASSWORD`
- `DEFAULT_CAMERA_USER`, `DEFAULT_CAMERA_PASSWORD`
- `FRIGATE_NAME`, `FRIGATE_URL`, `BASE_TOPIC`
Jesli sidecar ma startowac razem z istniejaca usluga Frigate, dopasuj w
`.container` nazwe `frigate.service` w polach `After`, `Requires`, `BindsTo`
i `PartOf`.
## EN
This is a generic example for running `frigate-camera-control-bridge` with
Podman Quadlet. The files model one Frigate instance. For multiple instances,
copy the `.container` and `.env` files and change `FRIGATE_NAME`,
`FRIGATE_URL`, `BASE_TOPIC`, the `PublishPort` binding, and MQTT credentials.
Example install:
```bash
install -d /etc/frigate-camera-control-bridge
install -m 0600 frigate-camera-control-bridge.env.example \
/etc/frigate-camera-control-bridge/frigate-main.env
install -m 0644 frigate-camera-control-bridge.container \
/etc/containers/systemd/frigate-camera-control-bridge.container
systemctl daemon-reload
systemctl enable --now frigate-camera-control-bridge.service
```
Fill these env values:
- `MQTT_HOST`, `MQTT_USER`, `MQTT_PASSWORD`
- `DEFAULT_CAMERA_USER`, `DEFAULT_CAMERA_PASSWORD`
- `FRIGATE_NAME`, `FRIGATE_URL`, `BASE_TOPIC`
If the sidecar should follow an existing Frigate service, adjust the
`frigate.service` references in `After`, `Requires`, `BindsTo`, and `PartOf`.
@@ -0,0 +1,25 @@
[Unit]
Description=Frigate camera control bridge sidecar
Wants=network-online.target
After=network-online.target frigate.service
Requires=frigate.service
BindsTo=frigate.service
PartOf=frigate.service
RequiresMountsFor=/var/lib/frigate-camera-control-bridge
[Container]
ContainerName=frigate-camera-control-bridge
Image=localhost/frigate-camera-control-bridge:1.0
PublishPort=0.0.0.0:5011:5011
Volume=/var/lib/frigate-camera-control-bridge:/var/lib/frigate-camera-control-bridge
Volume=/etc/localtime:/etc/localtime:ro
PodmanArgs=--env-file=/etc/frigate-camera-control-bridge/frigate-main.env
[Service]
Restart=on-failure
RestartSec=5s
TimeoutStartSec=180
[Install]
WantedBy=multi-user.target
WantedBy=frigate.service
@@ -0,0 +1,24 @@
FRIGATE_NAME=frigate-main
FRIGATE_URL=http://127.0.0.1:5000
BASE_TOPIC=frigate_camera_control/frigate-main
MQTT_HOST=mqtt.local
MQTT_PORT=1883
MQTT_USER=change-me
MQTT_PASSWORD=change-me
DEFAULT_CAMERA_USER=admin
DEFAULT_CAMERA_PASSWORD=change-me
HTTP_PORT=5011
UI_LANGUAGE=en
WAIT_FOR_FRIGATE=true
FRIGATE_RETRY_SECONDS=5
FRIGATE_STARTUP_WAIT_SECONDS=0
SNAPSHOT_ENABLED=true
SNAPSHOT_HEIGHT=180
SNAPSHOT_CACHE_SECONDS=300
SNAPSHOT_RETRY_SECONDS=600
SNAPSHOT_REFRESH_SECONDS=3600
SNAPSHOT_LIVE_ON_GUI=true