diff --git a/frigate/deploy.sh b/frigate/deploy.sh index 702dcf3..994a7c1 100644 --- a/frigate/deploy.sh +++ b/frigate/deploy.sh @@ -1,12 +1 @@ -helm repo add blakeblackshear https://blakeblackshear.github.io/blakeshome-charts/ - - -kubectl apply -f pvc.yaml - -helm upgrade --install \ - -n frigate \ - --create-namespace \ - frigate \ - blakeblackshear/frigate \ - -f values.yaml - +kustomize build --enable-helm | kubectl apply -f - diff --git a/frigate/diff.sh b/frigate/diff.sh index 5cc908d..0436bae 100644 --- a/frigate/diff.sh +++ b/frigate/diff.sh @@ -1,10 +1 @@ -helm repo add blakeblackshear https://blakeblackshear.github.io/blakeshome-charts/ && helm repo update - -kubectl diff -f pvc.yaml - -helm diff \ - -n frigate \ - frigate \ - blakeblackshear/frigate \ - -f values.yaml - +kustomize build --enable-helm | kubectl diff -f - diff --git a/frigate/kustomization.yaml b/frigate/kustomization.yaml new file mode 100644 index 0000000..68642f8 --- /dev/null +++ b/frigate/kustomization.yaml @@ -0,0 +1,151 @@ +kind: Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +helmCharts: + - name: frigate + repo: https://blakeblackshear.github.io/blakeshome-charts/ + namespace: frigate + version: 7.1.0 + releaseName: frigate + includeCRDs: true + valuesInline: + config: | + ffmpeg: + hwaccel_args: preset-nvidia-h264 + + go2rtc: + rtsp: + username: "${FRIGATE_RTSP_USER}" + password: "${FRIGATE_RTSP_PASSWORD}" + streams: + cammy: + - "rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@172.28.2.2:554" + + mqtt: + enabled: True + user: "{FRIGATE_MQTT_USER}" + password: "{FRIGATE_MQTT_PASSWORD}" + port: 1883 + host: 172.16.17.83 + + record: + enabled: True + events: + retain: + default: 10 + retain: + days: 7 + mode: motion + + cameras: + cammy: # <------ Name the camera + ffmpeg: + output_args: + record: preset-record-generic-audio-copy + inputs: + - path: "rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@127.0.0.1:8554/cammy" + input_args: preset-rtsp-restream + roles: + - record + - detect + #- path: "rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@172.28.2.2:554/cam/realmonitor?channel=1&subtype=0" + # roles: + # - detect + # - record + detect: + enabled: True # <---- disable detection until you have a working camera feed + width: 2592 # <---- update for your camera's resolution + height: 1944 # <---- update for your camera's resolution + live: + stream_name: cammy + objects: + track: + - person + - car + - dog + filters: + person: + mask: 1869,962,1672,667 + motion: + mask: + - 2592,0,2592,566,1811,389,1735,204,1802,69,1865,86,1909,59,1874,0 + zones: + left_street: + coordinates: 0,366,535,263,1337,244,1284,440,697,413,0,503 + sidewalk: + coordinates: 747,629,0,676,0,775,1491,733,1617,678,1756,703,2211,741,2183,682,1869,644 + steps: + coordinates: 2592,1531,2314,1472,1613,1004,1404,1002,1724,1944,2592,1944 + record: + events: + required_zones: + - steps + - sidewalk + - left_street + + + detectors: + tensorrt: + type: tensorrt + device: 0 #This is the default, select the first GPU + + model: + path: /trt-models/yolov7-640.trt + input_tensor: nchw + input_pixel_format: rgb + width: 640 + height: 640 + envFromSecrets: + - mqtt-broker + - rtsp-secret + extraVolumeMounts: + - mountPath: /trt-models + name: trt-models + - mountPath: /media + name: data + subPath: media + - mountPath: /media/frigate/clips + name: cctv-synology + subPath: clips + - mountPath: /media/frigate/recordings + name: cctv-synology + subPath: recordings + extraVolumes: + - name: trt-models + persistentVolumeClaim: + claimName: trt-models + - name: cctv-synology + nfs: + path: /volume1/cctv/frigate + server: 172.16.18.1 + gpu: + nvidia: + enabled: true + runtimeClassName: nvidia + image: + tag: 0.12.0-tensorrt + ingress: + enabled: false + hosts: + - host: frigate.strudelline.net + paths: + - / + nodeSelector: + kubernetes.io/hostname: chimecho + nvidia.com/gpu.family: pascal + persistence: + data: + enabled: true + size: 100Gi + skipuninstall: true + service: + type: ClusterIP +resources: + - build-trt-models.yaml + - ingress.yaml + - mqtt-broker-sealed.yaml + - oauth2-proxy-cookie-secret-sealed.yaml + - oauth2-proxy.yaml + - oidc-bypass-user-secret-sealed.yaml + - pvc.yaml + - rtsp-secret-sealed.yaml + - wildcard-tls.yaml diff --git a/frigate/values.yaml b/frigate/values.yaml deleted file mode 100644 index 6814038..0000000 --- a/frigate/values.yaml +++ /dev/null @@ -1,140 +0,0 @@ -image: - tag: "0.12.0-tensorrt" - -envFromSecrets: -- mqtt-broker -- rtsp-secret - -config: | - ffmpeg: - hwaccel_args: preset-nvidia-h264 - - go2rtc: - rtsp: - username: "${FRIGATE_RTSP_USER}" - password: "${FRIGATE_RTSP_PASSWORD}" - streams: - cammy: - - "rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@172.28.2.2:554" - - mqtt: - enabled: True - user: "{FRIGATE_MQTT_USER}" - password: "{FRIGATE_MQTT_PASSWORD}" - port: 1883 - host: 172.16.17.83 - - record: - enabled: True - events: - retain: - default: 10 - retain: - days: 7 - mode: motion - - cameras: - cammy: # <------ Name the camera - ffmpeg: - output_args: - record: preset-record-generic-audio-copy - inputs: - - path: "rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@127.0.0.1:8554/cammy" - input_args: preset-rtsp-restream - roles: - - record - - detect - #- path: "rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@172.28.2.2:554/cam/realmonitor?channel=1&subtype=0" - # roles: - # - detect - # - record - detect: - enabled: True # <---- disable detection until you have a working camera feed - width: 2592 # <---- update for your camera's resolution - height: 1944 # <---- update for your camera's resolution - live: - stream_name: cammy - objects: - track: - - person - - car - - dog - filters: - person: - mask: 1869,962,1672,667 - motion: - mask: - - 2592,0,2592,566,1811,389,1735,204,1802,69,1865,86,1909,59,1874,0 - zones: - left_street: - coordinates: 0,366,535,263,1337,244,1284,440,697,413,0,503 - sidewalk: - coordinates: 747,629,0,676,0,775,1491,733,1617,678,1756,703,2211,741,2183,682,1869,644 - steps: - coordinates: 2592,1531,2314,1472,1613,1004,1404,1002,1724,1944,2592,1944 - record: - events: - required_zones: - - steps - - sidewalk - - left_street - - - detectors: - tensorrt: - type: tensorrt - device: 0 #This is the default, select the first GPU - - model: - path: /trt-models/yolov7-640.trt - input_tensor: nchw - input_pixel_format: rgb - width: 640 - height: 640 - -service: - type: ClusterIP - -nodeSelector: - nvidia.com/gpu.family: pascal - -gpu: - nvidia: - enabled: true - runtimeClassName: nvidia - -ingress: - enabled: false - hosts: - - host: frigate.strudelline.net - paths: - - / - -extraVolumeMounts: -- name: trt-models - mountPath: /trt-models -- name: data - mountPath: /media - subPath: media -- name: cctv-synology - mountPath: /media/frigate/clips - subPath: clips -- name: cctv-synology - mountPath: /media/frigate/recordings - subPath: recordings - - -extraVolumes: -- name: trt-models - persistentVolumeClaim: - claimName: trt-models -- name: cctv-synology - nfs: - server: 172.16.18.1 - path: /volume1/cctv/frigate - -persistence: - data: - enabled: true - skipuninstall: true - size: 100Gi