Skip to content

Commit e868183

Browse files
committed
chore(k8s/amour/frigate): configure mqtt and tensorrt
1 parent d0616ec commit e868183

File tree

5 files changed

+68
-31
lines changed

5 files changed

+68
-31
lines changed

k8s/amour/frigate/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cue_library(
44
name = "cue_frigate_library",
55
srcs = [
66
"config_map_list.cue",
7+
"external_secret_list.cue",
78
"ingress_list.cue",
89
"list.cue",
910
"namespace_list.cue",
@@ -13,6 +14,7 @@ cue_library(
1314
importpath = "github.com/uhthomas/automata/k8s/amour/frigate",
1415
visibility = ["//visibility:public"],
1516
deps = [
17+
"//cue.mod/gen/github.com/external-secrets/external-secrets/apis/externalsecrets/v1beta1:cue_v1beta1_library",
1618
"//cue.mod/gen/k8s.io/api/apps/v1:cue_v1_library",
1719
"//cue.mod/gen/k8s.io/api/core/v1:cue_v1_library",
1820
"//cue.mod/gen/k8s.io/api/networking/v1:cue_v1_library",

k8s/amour/frigate/config_map_list.cue

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,29 @@ import (
1818
#ConfigMapList: items: [{
1919
data: "config.yaml": yaml.Marshal({
2020
mqtt: {
21-
// Required: host name
22-
host: "mqtt.server.com"
23-
// Optional: port (default: shown below)
24-
port: 1883
25-
// Optional: topic prefix (default: shown below)
26-
// WARNING: must be unique if you are running multiple instances
27-
topic_prefix: "frigate"
28-
// Optional: client id (default: shown below)
29-
// WARNING: must be unique if you are running multiple instances
30-
client_id: "frigate"
31-
// Optional: user
32-
user: "mqtt_user"
33-
// Optional: password
34-
// NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
35-
// eg. password: '{FRIGATE_MQTT_PASSWORD}'
36-
password: "password"
37-
// Optional: interval in seconds for publishing stats (default: shown below)
38-
stats_interval: 60
21+
host: "emqx.emqx"
22+
user: "frigate"
23+
password: "{FRIGATE_MQTT_PASSWORD}"
3924
}
40-
detectors: {
41-
// coral:
42-
// type: edgetpu
43-
// device: usb
44-
cpu1: {
45-
type: "cpu"
46-
}
25+
ffmpeg: hwaccel_args: "preset-nvidia-h264"
26+
detectors: tensorrt: {
27+
type: "tensorrt"
28+
device: 0
29+
}
30+
model: {
31+
path: "/config/model_cache/tensorrt/yolov7-320.trt"
32+
input_tensor: "nchw"
33+
input_pixel_format: "rgb"
34+
width: 320
35+
height: 320
36+
}
37+
cameras: dummy_camera: {
38+
enabled: false
39+
ffmpeg: inputs: [{
40+
path: "rtsp://127.0.0.1:554/rtsp"
41+
roles: ["detect"]
42+
}]
43+
4744
}
4845
})
4946
}]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package frigate
2+
3+
import externalsecretsv1beta1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1beta1"
4+
5+
#ExternalSecretList: externalsecretsv1beta1.#ExternalSecretList & {
6+
apiVersion: "external-secrets.io/v1beta1"
7+
kind: "ExternalSecretList"
8+
items: [...{
9+
apiVersion: "external-secrets.io/v1beta1"
10+
kind: "ExternalSecret"
11+
}]
12+
}
13+
14+
#ExternalSecretList: items: [{
15+
spec: {
16+
secretStoreRef: {
17+
name: "onepassword"
18+
kind: "ClusterSecretStore"
19+
}
20+
target: template: metadata: {
21+
annotations: {}
22+
labels: {}
23+
}
24+
data: [{
25+
secretKey: "mqtt-password"
26+
remoteRef: {
27+
key: "frigate-emqx"
28+
property: "password"
29+
}
30+
}]
31+
}
32+
}]

k8s/amour/frigate/list.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131

3232
_items: [
3333
#ConfigMapList.items,
34-
// #ExternalSecretList.items,
34+
#ExternalSecretList.items,
3535
#IngressList.items,
3636
#NamespaceList.items,
3737
#ServiceList.items,

k8s/amour/frigate/stateful_set_list.cue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,23 @@ import (
3838
containerPort: 8554
3939
}]
4040
env: [{
41+
name: "PUID"
42+
value: "1000"
43+
}, {
44+
name: "PGID"
45+
value: "3000"
46+
}, {
4147
name: "NVIDIA_DRIVER_CAPABILITIES"
4248
value: "all"
4349
}, {
4450
name: "NVIDIA_VISIBLE_DEVICES"
4551
value: "all"
4652
}, {
47-
name: "PUID"
48-
value: "1000"
49-
}, {
50-
name: "PGID"
51-
value: "3000"
53+
name: "FRIGATE_MQTT_PASSWORD"
54+
valueFrom: secretKeyRef: {
55+
name: #Name
56+
key: "mqtt-password"
57+
}
5258
}]
5359
resources: limits: {
5460
(v1.#ResourceCPU): "1"

0 commit comments

Comments
 (0)