From c3c03d11f31d5e7c80c9ed21cadf15304c1f2211 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Sun, 11 Jun 2023 02:58:28 +0300 Subject: [PATCH] chore(frigate): BREAKING CHANGE - Allow native helm users to use 1:1 configuration, and scale users to define a hostpath config file (#9575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [x] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/incubator/frigate/Chart.yaml | 2 +- .../frigate/ci/figrate-configfile-values.yaml | 1 + .../frigate/ci/figrateConfig-values.yaml | 11 + charts/incubator/frigate/questions.yaml | 1486 +---------------- .../frigate/templates/_configmap.tpl | 510 +----- .../incubator/frigate/templates/common.yaml | 9 + charts/incubator/frigate/values.yaml | 472 +----- 7 files changed, 111 insertions(+), 2380 deletions(-) create mode 100644 charts/incubator/frigate/ci/figrate-configfile-values.yaml create mode 100644 charts/incubator/frigate/ci/figrateConfig-values.yaml diff --git a/charts/incubator/frigate/Chart.yaml b/charts/incubator/frigate/Chart.yaml index 1023d2f353e..2ac60f86adb 100644 --- a/charts/incubator/frigate/Chart.yaml +++ b/charts/incubator/frigate/Chart.yaml @@ -23,7 +23,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/frigate - https://github.com/blakeblackshear/frigate type: application -version: 8.0.4 +version: 9.0.0 annotations: truecharts.org/catagories: | - nvr diff --git a/charts/incubator/frigate/ci/figrate-configfile-values.yaml b/charts/incubator/frigate/ci/figrate-configfile-values.yaml new file mode 100644 index 00000000000..d509f4f8485 --- /dev/null +++ b/charts/incubator/frigate/ci/figrate-configfile-values.yaml @@ -0,0 +1 @@ +frigateConfig: {} diff --git a/charts/incubator/frigate/ci/figrateConfig-values.yaml b/charts/incubator/frigate/ci/figrateConfig-values.yaml new file mode 100644 index 00000000000..6f451e708c8 --- /dev/null +++ b/charts/incubator/frigate/ci/figrateConfig-values.yaml @@ -0,0 +1,11 @@ +frigateConfig: + mqtt: + enabled: false + cameras: + dummy: + enabled: false + ffmpeg: + inputs: + - path: rtsp://127.0.0.1:554/rtsp + roles: + - detect diff --git a/charts/incubator/frigate/questions.yaml b/charts/incubator/frigate/questions.yaml index 43e5dcec3df..f26bdf4ef04 100644 --- a/charts/incubator/frigate/questions.yaml +++ b/charts/incubator/frigate/questions.yaml @@ -6,1455 +6,11 @@ questions: # Include{global} # Include{workload} # Include{workloadDeployment} - # Include{replicas1} # Include{podSpec} # Include{containerMain} # Include{containerBasic} # Include{containerAdvanced} - - - variable: frigate - group: App Configuration - label: Frigate Configuration - schema: - additional_attrs: true - type: dict - attrs: - - variable: mqtt - label: MQTT - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: true - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - schema: - type: boolean - default: true - - variable: host - label: Host - schema: - type: string - show_if: [["enabled", "=", true]] - required: true - default: "" - - variable: port - label: Port - schema: - type: int - show_if: [["enabled", "=", true]] - default: 1883 - - variable: topic_prefix - label: Topic Prefix - description: Must be unique if you are running multiple instances - schema: - type: string - show_if: [["enabled", "=", true]] - default: "" - - variable: client_id - label: Client ID - description: Must be unique if you are running multiple instances - schema: - type: string - show_if: [["enabled", "=", true]] - default: "" - - variable: stats_interval - label: Stats Interval - description: Interval in seconds for publishing stats - schema: - type: int - show_if: [["enabled", "=", true]] - "null": true - default: 60 - - variable: user - label: Username - schema: - type: string - show_if: [["enabled", "=", true]] - default: "" - - variable: password - label: Password - schema: - type: string - show_if: [["enabled", "=", true]] - private: true - default: "" - - variable: detectors - label: Detectors - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: config - label: Detectors Configuration - schema: - type: list - default: [] - items: - - variable: detector_entry - label: "" - schema: - additional_attrs: true - type: dict - attrs: - - variable: name - label: Name - description: Name of the detector - schema: - type: string - required: true - default: "" - - variable: type - label: Type - description: Name of the detector - schema: - type: string - required: true - default: cpu - enum: - - value: cpu - description: CPU - - value: edgetpu - description: Edge TPU - - variable: device - label: Device - description: Device name as defined here - https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api - schema: - type: string - default: "" - - variable: num_threads - label: Number of Threads - description: This value is only used for CPU types - schema: - type: int - "null": true - show_if: [["type", "=", "cpu"]] - - variable: model - label: Model - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: width - label: Width - schema: - type: int - required: true - default: 320 - - variable: height - label: Height - schema: - type: int - required: true - default: 320 - - variable: path - label: Path - schema: - type: string - default: "" - - variable: labelmap_path - label: Label Map Path - schema: - type: string - default: "" - - variable: labelmap - label: Label Map Configuration - schema: - type: list - default: [] - items: - - variable: labelmap_entry - label: "" - schema: - additional_attrs: true - type: dict - attrs: - - variable: model - label: Model - schema: - type: string - required: true - default: "" - - variable: name - label: Name - schema: - type: string - required: true - default: "" - - variable: logger - label: Logger - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: default - label: Default Log Verbosity - schema: - type: string - required: true - default: info - enum: - - value: info - description: Info - - value: debug - description: Debug - - value: warning - description: Warning - - value: error - description: Error - - value: critical - description: Critical - - variable: logs - label: Component Specific Logs - schema: - type: list - default: [] - items: - - variable: component_entry - label: "" - schema: - additional_attrs: true - type: dict - attrs: - - variable: component - label: Component - description: Find out the available components here https://docs.frigate.video/configuration/advanced/#logger - schema: - type: string - required: true - default: "" - - variable: verbosity - label: Default Log Verbosity - schema: - type: string - required: true - default: info - enum: - - value: info - description: Info - - value: debug - description: Debug - - value: warning - description: Warning - - value: error - description: Error - - value: critical - description: Critical - - variable: birdseye - label: Birds Eye - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - description: Enables the birdseye - schema: - type: boolean - default: true - - variable: width - label: Width - description: Width of the output resolution - schema: - type: int - "null": true - - variable: height - label: Height - description: Height of the output resolution - schema: - type: int - "null": true - - variable: quality - label: Quality - description: Encoding quality of the mpeg1 feed. Where 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources. - schema: - type: int - min: 1 - max: 31 - "null": true - - variable: mode - label: Mode - description: | - Mode of the view. - Objects - Cameras are included if they have had a tracked object within the last 30 seconds. - Motion - Cameras are included if motion was detected in the last 30 seconds. - Continuous - All cameras are included always. - schema: - type: string - default: "" - enum: - - value: "" - description: Inherit - - value: objects - description: Objects - - value: motion - description: Motion - - value: continuous - description: Continuous - - variable: ffmpeg - label: ffmpeg - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: global_args - label: Global Args - schema: - type: string - default: "" - - variable: hwaccel_args - label: HW Acceleration Args - description: See hardware acceleration docs for your specific device - schema: - type: string - default: "" - - variable: input_args - label: Input Args - schema: - type: string - default: "" - - variable: output_args - label: Output Args - schema: - additional_attrs: true - type: dict - attrs: - - variable: detect - label: Detect - schema: - type: string - default: "" - - variable: record - label: Record - schema: - type: string - default: "" - - variable: rtmp - label: RTMP - schema: - type: string - default: "" - - variable: detect - label: Detect - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - description: Enables detection for the cameras - schema: - type: boolean - default: true - - variable: width - label: Width - description: Width of the frame for the input with the detect role - schema: - type: int - "null": true - - variable: height - label: Height - description: Height of the frame for the input with the detect role - schema: - type: int - "null": true - - variable: fps - label: FPS - description: Desired fps for your camera for the input with the detect role. Recommended value of 5. Ideally, try and reduce your FPS on the camera. - schema: - type: int - "null": true - - variable: max_disappeared - label: Max Disappeared - description: Number of frames without a detection before frigate considers an object to be gone. - schema: - type: int - "null": true - - variable: stationary - label: Stationary - schema: - additional_attrs: true - type: dict - attrs: - - variable: interval - label: Interval - description: | - Frequency for confirming stationary objects - When set to 0, object detection will not confirm stationary objects until movement is detected. - If set to 10, object detection will run to confirm the object still exists on every 10th frame. - schema: - type: int - "null": true - - variable: threshold - label: Threshold - description: Number of frames without a position change for an object to be considered stationary - schema: - type: int - "null": true - - variable: set_max_frames - label: Set Max Frames - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: max_frames - label: Max Frames - schema: - additional_attrs: true - type: dict - attrs: - - variable: default - label: Default - description: Default for all object types - schema: - type: int - "null": true - - variable: objects - label: Objects - schema: - type: list - default: [] - items: - - variable: object_entry - label: Object Entry - schema: - additional_attrs: true - type: dict - attrs: - - variable: object - label: Object - schema: - type: string - required: true - default: "" - - variable: frames - label: Frames - schema: - type: int - required: true - - variable: objects - label: Objects - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: track - label: Track - description: Objects to track from labelmap.txt - schema: - type: list - default: [] - items: - - variable: track_entry - label: Track Object Entry - schema: - type: string - required: true - default: "" - - variable: mask - label: Mask - description: | - Mask to prevent all object types from being detected in certain areas - Checks based on the bottom center of the bounding box of the object. - This mask is COMBINED with the object type specific mask below - schema: - type: string - default: "" - - variable: filters - label: Filters - description: Filters to reduce false positives for specific object types - schema: - type: list - default: [] - items: - - variable: filter_entry - label: Filter Entry - schema: - additional_attrs: true - type: dict - attrs: - - variable: object - label: Object - description: For example person - schema: - type: string - required: true - default: "" - - variable: min_area - label: Min Area - description: Minimum width*height of the bounding box for the detected object - schema: - type: int - "null": true - - variable: max_area - label: Max Area - description: Maximum width*height of the bounding box for the detected object - schema: - type: int - "null": true - - variable: min_ratio - label: Min Ratio - description: Minimum width/height of the bounding box for the detected object - schema: - type: string - default: "" - valid_chars: '^[0-9]+(\.[0-9]*)?$' - - variable: max_ratio - label: Max Ratio - description: Maximum width/height of the bounding box for the detected object - schema: - type: string - default: "" - valid_chars: '^[0-9]+(\.[0-9]*)?$' - - variable: min_score - label: Min Score - description: Minimum score for the object to initiate tracking - schema: - type: string - default: "" - valid_chars: '^[0-9]+(\.[0-9]*)?$' - - variable: threshold - label: Threshold - description: Minimum decimal percentage for tracked object's computed score to be considered a true positive - schema: - type: string - default: "" - valid_chars: '^[0-9]+(\.[0-9]*)?$' - - variable: mask - label: Mask - description: | - Mask to prevent this object type from being detected in certain areas - Checks based on the bottom center of the bounding box of the object - schema: - type: string - default: "" - - variable: motion - label: Motion - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: threshold - label: Threshold - description: | - The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. - Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive. - schema: - type: int - min: 1 - max: 255 - "null": true - - variable: contour_area - label: Contour Area - description: | - Minimum size in pixels in the resized motion image that counts as motion - Increasing this value will prevent smaller areas of motion from being detected. Decreasing will - make motion detection more sensitive to smaller moving objects. - As a rule of thumb: - 15 - high sensitivity - 30 - medium sensitivity - 50 - low sensitivity - schema: - type: int - "null": true - - variable: delta_alpha - label: Delta Alpha - description: | - Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames - Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion. - Too low and a fast moving person wont be detected as motion. - schema: - type: string - default: "" - valid_chars: '^$|^[0-9]+(\.[0-9]*)?$' - - variable: frame_alpha - label: Frame Alpha - description: | - Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background - Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster. - Low values will cause things like moving shadows to be detected as motion for longer. - https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average - schema: - type: string - default: "" - valid_chars: '^$|^[0-9]+(\.[0-9]*)?$' - - variable: frame_height - label: Frame Height - description: | - Height of the resized motion frame - This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense - of higher CPU usage. Lower values result in less CPU, but small changes may not register as motion. - schema: - type: int - "null": true - - variable: mask - label: Mask - description: See docs for more detailed info on creating masks - schema: - type: string - default: "" - - variable: improve_contrast - label: Improve Contrast - description: Improve contrast. Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive for daytime. - schema: - type: boolean - default: false - - variable: mqtt_off_delay - label: MQTT Off Delay - description: Delay when updating camera motion through MQTT from ON -> OFF - schema: - type: int - "null": true - - variable: record - label: Record - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - description: | - Enable recording - WARNING: If recording is disabled in the config, turning it on via the UI or MQTT later will have no effect. - WARNING: Frigate does not currently support limiting recordings based on available disk space automatically. - If using recordings,you must specify retention settings for a number of days that will fit within the available disk space of your drive or Frigate will crash. - schema: - type: boolean - default: true - - variable: expire_interval - label: Expire Interval - description: Number of minutes to wait between cleanup runs - schema: - type: int - "null": true - - variable: retain - label: Record > Retain - description: Retention settings for recording - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Retain Config - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: days - label: Days - description: | - Number of days to retain recordings regardless of events - NOTE: This should be set to 0 and retention should be defined in events section below if you only want to retain recordings of events. - schema: - type: int - "null": true - - variable: mode - label: Mode - description: | - Mode for retention. - All - save all recording segments regardless of activity - Motion - save all recordings segments with any detected motion - Active Objects - save all recording segments with active/moving objects - NOTE: This mode only applies when the days setting above is greater than 0 - schema: - type: string - show_if: [["days", "!=", 0]] - default: "" - enum: - - value: "" - description: Inherit - - value: all - description: All - - value: motion - description: Motion - - value: active_objects - description: Active Objects - - variable: events - label: Record > Events - description: Event recording settings - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: pre_capture - label: Pre Capture - description: Number of seconds before the event to include - schema: - type: int - "null": true - - variable: post_capture - label: Post Capture - description: Number of seconds after the event to include - schema: - type: int - "null": true - - variable: objects - label: Objects - description: Objects to save recordings for. Defaults to all objects. - schema: - type: list - default: [] - items: - - variable: object_entry - label: "" - schema: - type: string - required: true - default: "" - - variable: required_zones - label: Required Zones - description: Restrict recordings to objects that entered any of the listed zones - schema: - type: list - default: [] - items: - - variable: zone_entry - label: "" - schema: - type: string - required: true - default: "" - - variable: retain - label: Record > Events > Retain - description: Retention settings for recordings of events - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Retain Config - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: default - label: Default - description: Default retention days - schema: - type: int - required: true - default: 10 - - variable: mode - label: Mode - description: | - Mode for retention. - All - save all recording segments for events regardless of activity - Motion - save all recordings segments for events with any detected motion - Active Objects - save all recording segments for event with active/moving objects - schema: - type: string - default: "" - enum: - - value: "" - description: Inherit - - value: all - description: All - - value: motion - description: Motion - - value: active_objects - description: Active Objects - - variable: objects - label: Objects - description: Per object retention days - schema: - type: list - default: [] - items: - - variable: objects_entry - label: "" - schema: - additional_attrs: true - type: dict - attrs: - - variable: object - label: Object - description: For example Person - schema: - type: string - required: true - default: "" - - variable: days - label: Retention Days - description: Retention days for the object - schema: - type: int - required: true - default: 15 - - variable: snapshots - label: Snapshots - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - description: | - Optional: Enable writing jpg snapshot to /media/frigate/clips - This value can be set via MQTT and will be updated in startup based on retained value - schema: - type: boolean - default: true - - variable: clean_copy - label: Clean Copy - description: Save a clean PNG copy of the snapshot image - schema: - type: boolean - default: true - - variable: timestamp - label: Timestamp - description: Print a timestamp on the snapshots - schema: - type: boolean - default: false - - variable: bounding_box - label: Bounding Box - description: Draw bounding box on the snapshots - schema: - type: boolean - default: false - - variable: crop - label: Crop - description: Crop the snapshot - schema: - type: boolean - default: false - - variable: height - label: Height - description: Height to resize the snapshot to - schema: - type: int - "null": true - - variable: required_zones - label: Required Zones - description: Restrict recordings to objects that entered any of the listed zones - schema: - type: list - default: [] - items: - - variable: zone_entry - label: Zone Entry - schema: - type: string - required: true - default: "" - - variable: retain - label: Snapshots > Retain - description: Retention settings for snapshots of events - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Retain Config - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: default - label: Default - description: Default retention days - schema: - type: int - required: true - default: 10 - - variable: objects - label: Objects - description: Per object retention days - schema: - type: list - default: [] - items: - - variable: objects_entry - label: Objects Entry - schema: - additional_attrs: true - type: dict - attrs: - - variable: object - label: Object - description: For example Person - schema: - type: string - required: true - default: "" - - variable: days - label: Retention Days - description: Retention days for the object - schema: - type: int - required: true - default: 15 - - variable: rtmp - label: RTMP - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - description: Enable the RTMP stream - schema: - type: boolean - default: true - - variable: live - label: Live - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: height - label: Height - description: | - Set the height of the live stream. - This must be less than or equal to the height of the detect stream. Lower resolutions - reduce bandwidth required for viewing the live stream. Width is computed to match known aspect ratio. - schema: - type: int - "null": true - - variable: quality - label: Quality - description: | - Set the encode quality of the live stream - 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources. - schema: - type: int - min: 1 - max: 31 - "null": true - - variable: timestamp_style - label: Timestamp Style - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: position - label: Position - description: Position of the timestamp - schema: - type: string - default: "" - enum: - - value: "" - description: Inherit - - value: tl - description: Top Left - - value: tr - description: Top Right - - value: bl - description: Bottom Left - - value: br - description: Bottom Right - - variable: format - label: Format - description: Format specifier conform to the Python package - schema: - type: string - default: "" - - variable: color - label: Timestamp Style > Color - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: red - label: Red - schema: - type: int - default: 255 - required: true - - variable: green - label: Green - schema: - type: int - required: true - default: 255 - - variable: blue - label: Blue - schema: - type: int - required: true - default: 255 - - variable: thickness - label: Thickness - description: Line thickness of font - schema: - type: int - "null": true - - variable: effect - label: Effect - description: | - Effect of lettering - Inherit - Inherit from default configuration - None - No effect - Solid - Solid background in inverse color of font - Shadow - Shadow for font - schema: - type: string - default: "" - enum: - - value: "" - description: Inherit - - value: None - description: None - - value: solid - description: Solid - - value: shadow - description: Shadow - - variable: cameras - label: Cameras - schema: - type: list - default: [] - items: - - variable: camera_entry - label: Camera Entry - schema: - additional_attrs: true - type: dict - attrs: - - variable: camera_name - label: Camera Name - schema: - type: string - required: true - default: "" - - variable: ffmpeg - label: ffmpeg - description: ffmpeg Settings for the camera - schema: - additional_attrs: true - type: dict - attrs: - - variable: inputs - label: Inputs - description: A list of input streams for the camera. See documentation for more information. - schema: - type: list - required: true - default: [] - items: - - variable: input_entry - label: "" - schema: - additional_attrs: true - type: dict - attrs: - - variable: path - label: Path - description: The path to the stream - schema: - type: string - required: true - default: "" - - variable: roles - label: Roles - schema: - type: list - required: true - default: [] - items: - - variable: role_entry - label: "" - schema: - type: string - required: true - default: "" - enum: - - value: detect - description: Detect - - value: rtmp - description: RTMP - - value: record - description: Record - - variable: global_args - label: Global Args - description: Stream specific global args - schema: - type: string - default: "" - - variable: hwaccel_args - label: HW Acceleration Args - description: Stream specific hwaccel args - schema: - type: string - default: "" - - variable: input_args - label: Input Args - description: Stream specific input args - schema: - type: string - default: "" - - variable: output_args - label: Output Args - schema: - additional_attrs: true - type: dict - attrs: - - variable: detect - label: Detect - schema: - type: string - default: "" - - variable: record - label: Record - schema: - type: string - default: "" - - variable: rtmp - label: RTMP - schema: - type: string - default: "" - - variable: global_args - label: Global Args - description: Camera specific global args - schema: - type: string - default: "" - - variable: hwaccel_args - label: HW Acceleration Args - description: Camera specific hwaccel args - schema: - type: string - default: "" - - variable: input_args - label: Input Args - description: Camera specific input args - schema: - type: string - default: "" - - variable: output_args - label: Output Args - schema: - additional_attrs: true - type: dict - attrs: - - variable: detect - label: Detect - schema: - type: string - default: "" - - variable: record - label: Record - schema: - type: string - default: "" - - variable: rtmp - label: RTMP - schema: - type: string - default: "" - - variable: best_image_timeout - label: Best Image Timeout - description: Timeout for highest scoring image before allowing it to be replaced by a newer image. - schema: - type: int - "null": true - - variable: zones - label: Zones - description: Zones for this camera - schema: - type: list - default: [] - items: - - variable: zone_entry - label: "" - schema: - additional_attrs: true - type: dict - attrs: - - variable: name - label: Zone Name - schema: - type: string - required: true - default: "" - - variable: coordinates - label: Coordinates - description: List of x,y coordinates to define the polygon of the zone. - schema: - type: string - required: true - default: "" - - variable: objects - label: Objects - schema: - type: list - default: [] - items: - - variable: object_entry - label: "" - description: For example person - schema: - type: string - required: true - default: "" - - variable: filters - label: Filters - description: Zone level object filters - schema: - type: list - default: [] - items: - - variable: filter_entry - label: Filter Entry - description: For example person - schema: - additional_attrs: true - type: dict - attrs: - - variable: object - label: Object - description: For example person - schema: - type: string - required: true - default: "" - - variable: min_area - label: Min Area - description: Minimum width*height of the bounding box for the detected object - schema: - type: int - "null": true - - variable: max_area - label: Max Area - description: Maximum width*height of the bounding box for the detected object - schema: - type: int - "null": true - - variable: threshold - label: Threshold - description: Minimum decimal percentage for tracked object's computed score to be considered a true positive - schema: - type: string - default: "" - valid_chars: '^[0-9]+(\.[0-9]*)?$' - - variable: mqtt - label: MQTT - description: MQTT Configuration for jpg snapshots published for this camera - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: Enabled - description: | - Enable publishing snapshot via mqtt for camera - NOTE: Only applies to publishing image data to MQTT via 'frigate///snapshot'. - All other messages will still be published. - schema: - type: boolean - default: true - - variable: timestamp - label: Timestamp - description: Print a timestamp on the snapshots - schema: - type: boolean - default: true - - variable: bounding_box - label: Bounding Box - description: Draw bounding box on the snapshots - schema: - type: boolean - default: true - - variable: crop - label: Crop - description: Crop the snapshot - schema: - type: boolean - default: true - - variable: height - label: Height - description: Height to resize the snapshot to - schema: - type: int - "null": true - - variable: quality - label: Quality - description: JPEG encode quality - schema: - type: int - "null": true - - variable: required_zones - label: Required Zones - description: Restrict mqtt messages to objects that entered any of the listed zones - schema: - type: list - default: [] - items: - - variable: required_zone - label: Required Zone - schema: - type: string - required: true - default: "" - - variable: ui - label: UI - description: Configuration for how camera is handled in the GUI. - schema: - additional_attrs: true - type: dict - attrs: - - variable: render_config - label: Render Configuration - description: Enable it to add the configuration in the config file - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: order - label: order - description: Adjust sort order of cameras in the UI. Larger numbers come later By default the cameras are sorted alphabetically. - schema: - "null": true - type: int - - variable: dashboard - label: Dashboard - description: Whether or not to show the camera in the Frigate UI - schema: - type: boolean - default: true # Include{containerConfig} # Include{podOptions} # Include{serviceRoot} @@ -1462,22 +18,22 @@ questions: # Include{serviceSelectorLoadBalancer} # Include{serviceSelectorExtras} - variable: main - label: "Main Service Port Configuration" + label: Main Service Port Configuration schema: additional_attrs: true type: dict attrs: - variable: port - label: "Port" - description: "This port exposes the container port on the service" + label: Port + description: This port exposes the container port on the service schema: type: int default: 10500 editable: true required: true - variable: rtmp - label: "RTMP Service" - description: "The service on which nodes connect to." + label: RTMP Service + description: The service on which nodes connect to. schema: additional_attrs: true type: dict @@ -1485,14 +41,14 @@ questions: # Include{serviceSelectorLoadBalancer} # Include{serviceSelectorExtras} - variable: rtmp - label: "RTMP Service Port Configuration" + label: RTMP Service Port Configuration schema: additional_attrs: true type: dict attrs: - variable: port - label: "Port" - description: "This port exposes the container port on the service" + label: Port + description: This port exposes the container port on the service schema: type: int default: 1935 @@ -1503,16 +59,16 @@ questions: # Include{serviceList} # Include{persistenceRoot} - variable: media - label: "App Media" - description: "Stores the Application Media" + label: App Media + description: Stores the Application Media and DB schema: additional_attrs: true type: dict attrs: # Include{persistenceBasic} - - variable: db - label: "App DB" - description: "Stores the Application DB" + - variable: config + label: App Config + description: Stores the Application Configuration schema: additional_attrs: true type: dict @@ -1521,7 +77,7 @@ questions: # Include{persistenceList} # Include{ingressRoot} - variable: main - label: "Main Ingress" + label: Main Ingress schema: additional_attrs: true type: dict @@ -1531,17 +87,16 @@ questions: # Include{ingressTraefik} # Include{ingressAdvanced} # Include{ingressList} - # Include{securityContextRoot} - variable: runAsUser - label: "runAsUser" - description: "The UserID of the user running the application" + label: runAsUser + description: The UserID of the user running the application schema: type: int default: 0 - variable: runAsGroup - label: "runAsGroup" - description: "The groupID this App of the user running the application" + label: runAsGroup + description: The groupID this App of the user running the application schema: type: int default: 0 @@ -1549,12 +104,11 @@ questions: # Include{securityContextAdvanced} # Include{securityContextPod} - variable: fsGroup - label: "fsGroup" - description: "The group that should own ALL storage." + label: fsGroup + description: The group that should own ALL storage. schema: type: int default: 568 - # Include{resources} # Include{advanced} # Include{addons} diff --git a/charts/incubator/frigate/templates/_configmap.tpl b/charts/incubator/frigate/templates/_configmap.tpl index d2e871638fd..ebf25801a72 100644 --- a/charts/incubator/frigate/templates/_configmap.tpl +++ b/charts/incubator/frigate/templates/_configmap.tpl @@ -2,495 +2,41 @@ {{- define "frigate.configmap" -}} enabled: true data: + {{- if .Values.frigateConfig }} config.yml: | - database: - path: /db/frigate.db - + {{- .Values.frigateConfig | toYaml | nindent 4 }} + {{- else }} + config.yml.dummy: | mqtt: - {{- include "frigate.mqtt" .Values.frigate.mqtt | indent 6 }} - - {{- if and .Values.frigate.detectors.render_config .Values.frigate.detectors.config }} - detectors: - {{- include "frigate.detectors" .Values.frigate.detectors | indent 6 }} - {{- end }} - - {{- if .Values.frigate.model.render_config }} - model: - {{- include "frigate.model" .Values.frigate.model | indent 6 }} - {{- end }} - - {{- if .Values.frigate.logger.render_config }} - logger: - {{- include "frigate.logger" .Values.frigate.logger | indent 6 }} - {{- end }} - - {{- if .Values.frigate.birdseye.render_config }} - birdseye: - {{- include "frigate.birdseye" .Values.frigate.birdseye | indent 6 }} - {{- end }} - - {{- if .Values.frigate.ffmpeg.render_config }} - ffmpeg: - {{- include "frigate.ffmpeg" .Values.frigate.ffmpeg | indent 6 }} - {{- end }} - - {{- if .Values.frigate.detect.render_config }} - detect: - {{- include "frigate.detect" .Values.frigate.detect | indent 6 }} - {{- end -}} - - {{- if .Values.frigate.objects.render_config }} - objects: - {{- include "frigate.objects" .Values.frigate.objects | indent 6 }} - {{- end }} - - {{- if .Values.frigate.motion.render_config }} - motion: - {{- include "frigate.motion" .Values.frigate.motion | indent 6 }} - {{- end }} - - {{- if .Values.frigate.record.render_config }} - record: - {{- include "frigate.record" .Values.frigate.record | indent 6 }} - {{- end }} - - {{- if .Values.frigate.snapshots.render_config }} - snapshots: - {{- include "frigate.snapshots" .Values.frigate.snapshots | indent 6 }} - {{- end }} - - {{- if .Values.frigate.rtmp.render_config }} - rtmp: - {{- include "frigate.rtmp" .Values.frigate.rtmp | indent 6 }} - {{- end }} - - {{- if .Values.frigate.live.render_config }} - live: - {{- include "frigate.live" .Values.frigate.live | indent 6 }} - {{- end }} - - {{- if .Values.frigate.timestamp_style.render_config }} - timestamp_style: - {{- include "frigate.timestamp_style" .Values.frigate.timestamp_style | indent 6 }} - {{- end }} - - {{- $cameras := .Values.frigate.cameras }} + enabled: false cameras: - {{- range $cam := $cameras }} - {{ $cam.camera_name | required "You need to provide a camera name" }}: + dummy: + enabled: false ffmpeg: inputs: - {{- range $input := $cam.ffmpeg.inputs }} - - path: {{ $input.path | required "You need to provide a path" }} + - path: rtsp://127.0.0.1:554/rtsp roles: - {{- range $role := $input.roles }} - - {{ $role }} - {{- else -}} - {{- fail "You need to provide roles" -}} - {{- end -}} - {{- include "frigate.ffmpeg" $input | indent 14 }} - {{- end -}} {{/* End range $cam.ffmpeg.inputs */}} - {{- include "frigate.ffmpeg" $cam.ffmpeg | indent 10 }} - {{- with $cam.best_image_timeout }} - best_image_timeout: {{ . }} - {{- end -}} - {{- with $cam.zones }} - zones: - {{- range $zone := . }} - {{ $zone.name | required "You have to specify a zone name" }}: - coordinates: {{ required "You have to specify coordinates" .coordinates }} - {{- with $zone.objects }} - objects: - {{- range $obj := . }} - - {{ $obj }} - {{- end -}} - {{- end -}} - {{- with $zone.filters }} - filters: - {{- range $filter := . }} - {{ $filter.object | required "You have to specify an object" }}: - {{- with $filter.min_area }} - min_area: {{ . }} - {{- end -}} - {{- with $filter.max_area }} - max_area: {{ . }} - {{- end -}} - {{- with $filter.threshold }} - threshold: {{ . }} - {{- end -}} - {{- end -}} {{/* end range filters */}} - {{- end -}} {{/* end with filter */}} - {{- end -}} {{/* end range zones */}} - {{- end -}} {{/* end with zones */}} - {{- if $cam.mqtt.render_config -}} - {{- with $cam.mqtt }} - mqtt: - enabled: {{ ternary "True" "False" .enabled }} - timestamp: {{ ternary "True" "False" .timestamp }} - bounding_box: {{ ternary "True" "False" .bounding_box }} - crop: {{ ternary "True" "False" .crop }} - {{- with .height }} - height: {{ . }} - {{- end -}} - {{- with .quality }} - quality: {{ . }} - {{- end -}} - {{- with .required_zones }} - required_zones: - {{- range $zone := . }} - - {{ $zone }} - {{- end -}} - {{- end -}} - {{- end -}} {{/* end with mqtt */}} - {{- end -}} {{/* end if mqtt.render_config */}} - {{- if $cam.ui.render_config -}} - {{- with $cam.ui }} - ui: - {{- if not (kindIs "invalid" .order) }} - order: {{ .order }} - {{- end }} - dashboard: {{ ternary "True" "False" .dashboard }} - {{- end -}} {{/* end with ui */}} - {{- end -}} {{/* end if ui.render_config */}} - {{- end -}} {{/* end range cameras */}} -{{- end }} - -{{- define "frigate.ffmpeg" -}} -{{- $ffmpeg := . -}} - -{{- with $ffmpeg.global_args }} -global_args: {{ . }} -{{- end -}} -{{- with $ffmpeg.input_args }} -input_args: {{ . }} -{{- end -}} -{{- with $ffmpeg.hwaccel_args }} -hwaccel_args: {{ . }} -{{- end -}} -{{- if $ffmpeg.output_args -}} -{{- if or $ffmpeg.output_args.detect $ffmpeg.output_args.record $ffmpeg.output_args.rtmp }} -output_args: - {{- with $ffmpeg.output_args.detect }} - detect: {{ . }} - {{- end -}} - {{- with $ffmpeg.output_args.record }} - record: {{ . }} - {{- end -}} - {{- with $ffmpeg.output_args.rtmp }} - rtmp: {{ . }} - {{- end -}} -{{- end -}} -{{- end -}} + - detect + {{- end }} {{- end -}} -{{- define "frigate.detect" -}} -{{- $detect := . }} -enabled: {{ ternary "True" "False" $detect.enabled }} -{{- with $detect.width }} -width: {{ . }} -{{- end -}} -{{- with $detect.height }} -height: {{ . }} -{{- end -}} -{{- with $detect.fps }} -fps: {{ . }} -{{- end -}} -{{- with $detect.max_disappeared }} -max_disappeared: {{ . }} -{{- end -}} -{{- if or (not (kindIs "invalid" $detect.stationary.interval)) $detect.stationary.threshold $detect.stationary.set_max_frames }} -stationary: - {{- if not (kindIs "invalid" $detect.stationary.interval) }} {{/* invalid kind means its empty (0 is not empty) */}} - interval: {{ $detect.stationary.interval }} - {{- end -}} - {{- with $detect.stationary.threshold }} - threshold: {{ . }} - {{- end -}} - {{- if (hasKey $detect.stationary "max_frames") }} - {{- if or $detect.stationary.max_frames.default $detect.stationary.max_frames.objects }} - max_frames: - {{- with $detect.stationary.max_frames.default }} - default: {{ . }} - {{- end -}} - {{- with $detect.stationary.max_frames.objects }} - objects: - {{- range $obj := . }} - {{ $obj.object | required "You need to provide an object" }}: {{ $obj.frames | required "You need to provide frames" }} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.motion" -}} -{{- $motion := . -}} - -{{- with $motion.threshold }} -threshold: {{ . }} -{{- end -}} -{{- with $motion.contour_area }} -contour_area: {{ . }} -{{- end -}} -{{- with $motion.delta_alpha }} -delta_alpha: {{ . }} -{{- end -}} -{{- with $motion.frame_alpha }} -frame_alpha: {{ . }} -{{- end -}} -{{- with $motion.frame_height }} -frame_height: {{ . }} -{{- end -}} -{{- with $motion.mask }} -mask: {{ . }} -{{- end }} -improve_contrast: {{ ternary "True" "False" $motion.improve_contrast }} -{{- with $motion.mqtt_off_delay }} -mqtt_off_delay: {{ . }} -{{- end -}} -{{- end -}} - -{{- define "frigate.record" -}} -{{- $record := . }} -enabled: {{ ternary "True" "False" $record.enabled }} -{{- with $record.expire_interval }} -expire_interval: {{ . }} -{{- end -}} -{{- if $record.retain.render_config }} -retain: - {{- if not (kindIs "invalid" $record.retain.days) }} - days: {{ $record.retain.days }} - {{- end -}} - {{- with $record.retain.mode }} - mode: {{ . }} - {{- end -}} -{{- end -}} -{{- if $record.events.render_config }} -events: - {{- if not (kindIs "invalid" $record.events.pre_capture) }} - pre_capture: {{ $record.events.pre_capture }} - {{- end -}} - {{- if not (kindIs "invalid" $record.events.post_capture) }} - post_capture: {{ $record.events.post_capture }} - {{- end -}} - {{- with $record.events.objects }} - objects: - {{- range $obj := . }} - - {{ $obj }} - {{- end -}} - {{- end -}} - {{- with $record.events.required_zones }} - required_zones: - {{- range $zone := . }} - - {{ $zone }} - {{- end -}} - {{- end -}} - {{- if $record.events.retain.render_config }} - retain: - default: {{ $record.events.retain.default | required "You need to provide default retain days" }} - {{- with $record.events.retain.mode }} - mode: {{ . }} - {{- end -}} - {{- with $record.events.retain.objects }} - objects: - {{- range $obj := . }} - {{ $obj.object | required "You need to provide an object" }}: {{ $obj.days | required "You need to provide default retain days" }} - {{- end -}} - {{- end -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.objects" -}} -{{- $objects := . -}} - -{{- with $objects.track }} -track: - {{- range $track := . }} - - {{ $track }} - {{- end -}} -{{- end -}} -{{- with $objects.mask }} -mask: {{ . }} -{{- end -}} -{{- with $objects.filters }} -filters: - {{- range $filter := . }} - {{ $filter.object | required "You need to provide an object" }}: - {{- with $filter.min_area }} - min_area: {{ . }} - {{- end -}} - {{- with $filter.max_area }} - max_area: {{ . }} - {{- end -}} - {{- with $filter.min_ratio }} - min_ratio: {{ . }} - {{- end -}} - {{- with $filter.max_ratio }} - max_ratio: {{ . }} - {{- end -}} - {{- with $filter.min_score }} - min_score: {{ . }} - {{- end -}} - {{- with $filter.threshold }} - threshold: {{ . }} - {{- end -}} - {{- with $filter.mask }} - mask: {{ . }} - {{- end -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.birdseye" -}} -{{- $birdseye := . }} -enabled: {{ ternary "True" "False" $birdseye.enabled }} -{{- with $birdseye.width }} -width: {{ . }} -{{- end -}} -{{- with $birdseye.height }} -height: {{ . }} -{{- end -}} -{{- with $birdseye.quality }} -quality: {{ . }} -{{- end -}} -{{- with $birdseye.mode }} -mode: {{ . }} -{{- end -}} -{{- end -}} - -{{- define "frigate.timestamp_style" -}} -{{- $timestamp_style := . -}} - -{{- with $timestamp_style.position }} -position: {{ . }} -{{- end -}} -{{- with $timestamp_style.format }} -format: {{ . }} -{{- end -}} -{{- if $timestamp_style.color.render_config }} -color: - red: {{ $timestamp_style.color.red }} - green: {{ $timestamp_style.color.green }} - blue: {{ $timestamp_style.color.blue }} -{{- end -}} -{{- with $timestamp_style.thickness }} -thickness: {{ . }} -{{- end -}} -{{- with $timestamp_style.effect }} -effect: {{ $timestamp_style.effect }} -{{- end -}} -{{- end -}} - -{{- define "frigate.live" -}} -{{- $live := . -}} -{{- with $live.height }} -height: {{ . }} -{{- end -}} -{{- with $live.quality }} -quality: {{ . }} -{{- end -}} -{{- end -}} - -{{- define "frigate.rtmp" -}} -{{- $rtmp := . }} -enabled: {{ ternary "True" "False" $rtmp.enabled }} -{{- end -}} - -{{- define "frigate.snapshots" -}} -{{- $snapshots := . }} -enabled: {{ ternary "True" "False" $snapshots.enabled }} -clean_copy: {{ ternary "True" "False" $snapshots.clean_copy }} -timestamp: {{ ternary "True" "False" $snapshots.timestamp }} -bounding_box: {{ ternary "True" "False" $snapshots.bounding_box }} -crop: {{ ternary "True" "False" $snapshots.crop }} -{{- with $snapshots.height }} -height: {{ . }} -{{- end -}} -{{- with $snapshots.required_zones }} -required_zones: - {{- range $zone := . }} - - {{ $zone }} - {{- end -}} -{{- end -}} -{{- if $snapshots.retain.render_config }} -retain: - default: {{ $snapshots.retain.default | required "You need to provide default retain days" }} - {{- with $snapshots.retain.objects }} - objects: - {{- range $obj := . }} - {{ $obj.object | required "You need to provide an object" }}: {{ $obj.days | required "You need to provide default retain days" }} - {{- end -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.detectors" -}} -{{- $detectors := . -}} - -{{- range $detector := $detectors.config }} -{{ $detector.name | required "You need to provide a detector name" }}: - type: {{ $detector.type | required "You need to provide a detector type" }} - {{- with $detector.device }} - device: {{ . }} - {{- end -}} - {{- with $detector.num_threads }} - num_threads: {{ . }} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.model" -}} -{{ $model := . }} -width: {{ $model.width | required "You need to provide a model width" }} -height: {{ $model.height | required "You need to provide a model height" }} -{{- with $model.path }} -path: {{ . }} -{{- end -}} -{{- with $model.labelmap_path }} -labelmap_path: {{ . }} -{{- end -}} -{{- with $model.labelmap }} -labelmap: - {{- range $lmap := . }} - {{ $lmap.model | required "You need to provide a labelmap model" }}: {{ $lmap.name | required "You need to provide a labelmap name" }} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.logger" -}} -{{- $logger := . }} -default: {{ $logger.default }} -{{- with $logger.logs }} -logs: - {{- range $log := . }} - {{ $log.component | required "You need to provide a logger cmponent" }}: {{ $log.verbosity | required "You need to provide logger verbosity" }} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "frigate.mqtt" -}} -{{- $mqtt := . }} -{{- if $mqtt.render_config }} -enabled: {{ ternary "True" "False" $mqtt.enabled }} -host: {{ required "You need to provide an MQTT host" $mqtt.host }} -{{- with $mqtt.port }} -port: {{ . }} -{{- end -}} -{{- with $mqtt.topic_prefix }} -topic_prefix: {{ . }} -{{- end -}} -{{- with $mqtt.client_id }} -client_id: {{ . }} -{{- end -}} -{{- if not (kindIs "invalid" $mqtt.stats_interval) }} -stats_interval: {{ $mqtt.stats_interval }} -{{- end -}} -{{- with $mqtt.user }} -user: {{ . }} -{{- end -}} -{{- with $mqtt.password }} -password: {{ . }} -{{- end -}} +{{- define "frigate.configVolume" -}} +enabled: true +type: configmap +objectName: frigate-config +targetSelector: + main: + main: {} + init-config: {} +{{- if .Values.frigateConfig }} +mountPath: /config +items: + - key: config.yml + path: config.yml +{{- else }} +mountPath: /dummy-config +items: + - key: config.yml.dummy + path: config.yml.dummy {{- end -}} {{- end -}} diff --git a/charts/incubator/frigate/templates/common.yaml b/charts/incubator/frigate/templates/common.yaml index d1ee5e989de..6ec5e06b3cc 100644 --- a/charts/incubator/frigate/templates/common.yaml +++ b/charts/incubator/frigate/templates/common.yaml @@ -7,5 +7,14 @@ {{- $_ := set .Values.configmap "frigate-config" $config -}} {{- end -}} +{{- if not .Values.frigateConfig -}} + {{- $_ := set .Values.persistence.config "enabled" true -}} +{{- end -}} + +{{- $vol := include "frigate.configVolume" . | fromYaml -}} +{{- if $vol -}} + {{- $_ := set .Values.persistence "frigate-config" $vol -}} +{{- end -}} + {{/* Render the templates */}} {{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/frigate/values.yaml b/charts/incubator/frigate/values.yaml index 34f2a107db2..6b31a3345b0 100644 --- a/charts/incubator/frigate/values.yaml +++ b/charts/incubator/frigate/values.yaml @@ -3,433 +3,46 @@ image: pullPolicy: IfNotPresent tag: v0.12.0@sha256:6fac983662fc6095ffdc8dd494f0c918192ddab80602f01d50a3569dab868148 +# When this is defined, the contents will be mounted +# as configmap into the container at /config/config.yml. +frigateConfig: {} + # -- https://docs.frigate.video/configuration/ + # mqtt: + # enabled: False + # cameras: + # dummy: + # enabled: False + # ffmpeg: + # inputs: + # - path: rtsp://127.0.0.1:554/rtsp + # roles: + # - detect + +workload: + main: + podSpec: + initContainers: + init-config: + enabled: "{{ not .Values.frigateConfig }}" + type: init + imageSelector: alpineImage + command: + - /bin/sh + - -c + - | + mkdir -p /config + if [ ! -f /config/config.yml ]; then + echo "Config file not found, copying dummy..." + cp /dummy-config/config.yml.dummy /config/config.yml + echo "Config file copied, you can now edit it at /config/config.yml" + fi + securityContext: container: readOnlyRootFilesystem: false runAsNonRoot: false runAsUser: 0 runAsGroup: 0 -# -- The "render_config" key is only used internally to "render" or not the configuration -# - Some parts of the config bellow are slightly modified so they can be added on SCALE UI. Mainly lists. -# - Do not blindly copy paste configuration from upstream. As this won't work on all cases -# - Where you see "null" set as default is ignored by the configmap. (Not all keys are supported). -# - Those "nulls" should be replaced with integers (if you want to set a value) -frigate: - mqtt: - # -- Enable it to add the configuration in the config file - render_config: true - # -- Enables MQTT - enabled: false - host: mqtt.server.com - port: 1883 - # -- NOTE: Must be unique if you are running multiple instances - topic_prefix: "" - # -- NOTE: Must be unique if you are running multiple instances - client_id: "" - user: "" - password: "" - stats_interval: 60 - - detectors: - # -- Enable it to add the configuration in the config file - render_config: false - config: [] - # -- Required: Name of the detector - # - name: coral - # # -- Valid values are 'edgetpu' (requires device property below) and 'cpu'. - # type: edgetpu - # # -- Device name as defined here: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api - # device: usb - # # -- This value is only used for CPU types - # num_threads: 3 - - model: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Required: Object detection model input width - width: 320 - # -- Required: Object detection model input height - height: 320 - # -- Optional: Path to the model - path: "" - # -- Optional: Path to the labelmap - labelmap_path: "" - # -- Optional: Label name modifications. - labelmap: [] - # - model: "2" - # name: vehicle - # - model: 3 - # name: vehicle - - logger: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Default log verbosity (default: shown below) - default: info - # -- Optional: Component specific logger overrides - logs: [] - # - component: frigate.event - # verbosity: debug - - birdseye: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Enables birdseye - enabled: true - # -- Optional: Width of the output resolution - width: null - # -- Optional: Height of the output resolution - height: null - # -- Optional: Encoding quality of the mpeg1 feed - # - 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources. - quality: null - # -- Optional: Mode of the view. Available options are: objects, motion, and continuous - # - objects - cameras are included if they have had a tracked object within the last 30 seconds - # - motion - cameras are included if motion was detected in the last 30 seconds - # - continuous - all cameras are included always - mode: "" - - ffmpeg: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: global ffmpeg args - global_args: "" - # -- Optional: global input args - input_args: "" - # -- Optional: global hwaccel args - # - NOTE: See hardware acceleration docs for your specific device - hwaccel_args: "" - # -- Optional: global output args - output_args: - # -- Optional: output args for detect streams - detect: "" - # -- Optional: output args for record streams - record: "" - # -- Optional: output args for rtmp streams - rtmp: "" - - detect: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Enables detection for the camera. - # - This value can be set via MQTT and will be updated in startup based on retained value - enabled: true - # -- Optional: width of the frame for the input with the detect role - width: null - # -- Optional: height of the frame for the input with the detect role - height: null - # -- Optional: desired fps for your camera for the input with the detect role - # - NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera. - fps: null - # -- Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate) - max_disappeared: null - # -- Optional: Configuration for stationary object tracking - stationary: - # -- Optional: Frequency for confirming stationary objects - # - When set to 0, object detection will not confirm stationary objects until movement is detected. - # - If set to 10, object detection will run to confirm the object still exists on every 10th frame. - interval: null - # -- Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s) - threshold: null - # -- Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever) - # - This can help with false positives for objects that should only be stationary for a limited amount of time. - # - It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave - # - car at the default. - # - WARNING: Setting these values overrides default behavior and disables stationary object tracking. - # - There are very few situations where you would want it disabled. It is NOT recommended to - # - copy these values from the example config into your config unless you know they are needed. - # max_frames: - # # -- Optional: Default for all object types (default: not set, track forever) - # default: - # # -- Optional: Object specific values - # objects: - # - object: person - # frames: 1000 - - objects: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: list of objects to track from labelmap.txt - track: [] - # - person - # - car - # -- Optional: mask to prevent all object types from being detected in certain areas (default: no mask) - # - Checks based on the bottom center of the bounding box of the object. - # - NOTE: This mask is COMBINED with the object type specific mask below - mask: "" - # - Optional: filters to reduce false positives for specific object types - filters: [] - # - object: person - # # -- Optional: Minimum width*height of the bounding box for the detected object - # min_area: 5000 - # # -- Optional: Maximum width*height of the bounding box for the detected object - # max_area: 100000 - # # -- Optional: Minimum width/height of the bounding box for the detected object - # min_ratio: "0.5" - # # -- Optional: Maximum width/height of the bounding box for the detected object - # max_ratio: "2.0" - # # -- Optional: Minimum score for the object to initiate tracking - # min_score: "0.5" - # # -- Optional: Minimum decimal percentage for tracked object's computed score to be considered a true positive - # threshold: "0.7" - # # -- Optional: Mask to prevent this object type from being detected in certain areas - # # - Checks based on the bottom center of the bounding box of the object - # mask: 0,0,1000,0,1000,200,0,200 - - motion: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. - # - Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive. - # - The value should be between 1 and 255. - threshold: null - # -- Optional: Minimum size in pixels in the resized motion image that counts as motion - # - Increasing this value will prevent smaller areas of motion from being detected. Decreasing will - # - make motion detection more sensitive to smaller moving objects. - # - As a rule of thumb: - # - 15 - high sensitivity - # - 30 - medium sensitivity - # - 50 - low sensitivity - contour_area: null - # -- Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames - # - Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion. - # - Too low and a fast moving person wont be detected as motion. - delta_alpha: "" - # -- Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background - # - Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster. - # - Low values will cause things like moving shadows to be detected as motion for longer. - # - https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/ - frame_alpha: "" - # -- Optional: Height of the resized motion frame (default: 50) - # - This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense - # - of higher CPU usage. Lower values result in less CPU, but small changes may not register as motion. - frame_height: null - # -- Optional: motion mask - # - NOTE: see docs for more detailed info on creating masks - mask: "" - # -- Optional: improve contrast - # - Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive - # - for daytime. - improve_contrast: false - # -- Optional: Delay when updating camera motion through MQTT from ON -> OFF - mqtt_off_delay: null - - record: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Enable recording - # - WARNING: If recording is disabled in the config, turning it on via - # - the UI or MQTT later will have no effect. - # - WARNING: Frigate does not currently support limiting recordings based - # - on available disk space automatically. If using recordings, - # - you must specify retention settings for a number of days that - # - will fit within the available disk space of your drive or Frigate will crash. - enabled: false - # -- Optional: Number of minutes to wait between cleanup runs - # - This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o - expire_interval: - # -- Optional: Retention settings for recording - retain: - # -- Render retain config - render_config: false - # -- Optional: Number of days to retain recordings regardless of events - # - NOTE: This should be set to 0 and retention should be defined in events section below - # - if you only want to retain recordings of events. - days: - # -- Optional: Mode for retention. Available options are: all, motion, and active_objects - # - all - save all recording segments regardless of activity - # - motion - save all recordings segments with any detected motion - # - active_objects - save all recording segments with active/moving objects - # - NOTE: this mode only applies when the days setting above is greater than 0 - mode: "" - # -- Optional: Event recording settings - events: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Number of seconds before the event to include - pre_capture: null - # -- Optional: Number of seconds after the event to include - post_capture: null - # -- Optional: Objects to save recordings for. Defaults to all - objects: [] - # - person - # -- Optional: Restrict recordings to objects that entered any of the listed zones - required_zones: [] - # -- Optional: Retention settings for recordings of events - retain: - # -- Render retain config - render_config: false - # -- Required: Default retention days - default: 10 - # -- Optional: Mode for retention. - # - all - save all recording segments for events regardless of activity - # - motion - save all recordings segments for events with any detected motion - # - active_objects - save all recording segments for event with active/moving objects - mode: "" - # -- Optional: Per object retention days - objects: [] - # - object: person - # days: 15 - - snapshots: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Enable writing jpg snapshot to /media/frigate/clips - # - This value can be set via MQTT and will be updated in startup based on retained value - enabled: false - # -- Optional: Save a clean PNG copy of the snapshot image - clean_copy: true - # -- Optional: print a timestamp on the snapshots - timestamp: false - # -- Optional: draw bounding box on the snapshots - bounding_box: false - # -- Optional: crop the snapshot - crop: false - # -- Optional: height to resize the snapshot to (default: original size) - height: - # -- Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones) - required_zones: [] - # -- Optional: Camera override for retention settings (default: global values) - retain: - # -- Render retain config - render_config: false - # -- Required: Default retention days (default: shown below) - default: 10 - # -- Optional: Per object retention days - objects: [] - # - object: person - # days: 15 - - rtmp: - # -- Enable it to add the configuration in the config file - render_config: false - # - Optional: Enable the RTMP stream - enabled: true - - live: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Set the height of the live stream. (default: 720) - # - This must be less than or equal to the height of the detect stream. Lower resolutions - # - reduce bandwidth required for viewing the live stream. Width is computed to match known aspect ratio. - height: null - # -- Optional: Set the encode quality of the live stream (default: shown below) - # - 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources. - quality: null - - timestamp_style: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Position of the timestamp - # - "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right) - position: "" - # -- Optional: Format specifier conform to the Python package "datetime" - # - Additional Examples: - # - german: "%d.%m.%Y %H:%M:%S" - format: "" - # -- Optional: Color of font - color: - # -- Enable it to add the configuration in the config file - render_config: false - # -- All Required when color is specified (default: shown below) - red: 255 - green: 255 - blue: 255 - # -- Optional: Line thickness of font (default: shown below) - thickness: null - # -- Optional: Effect of lettering (default: shown below) - # - None (No effect), - # - "solid" (solid background in inverse color of font) - # - "shadow" (shadow for font) - effect: "" - - cameras: - # -- Required: name of the camera - - camera_name: back - # -- Required: ffmpeg settings for the camera - ffmpeg: - # -- Required: A list of input streams for the camera. See documentation for more information. - inputs: - # -- Required: the path to the stream - - path: rtsp://viewer:password@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2 - # -- Required: list of roles for this stream. valid values are: detect,record,rtmp - # - NOTICE: In addition to assigning the record, and rtmp roles, - # - they must also be enabled in the camera config. - roles: - - detect - - rtmp - # -- Optional: stream specific global args - global_args: "" - # - Optional: stream specific hwaccel args - hwaccel_args: "" - # - Optional: stream specific input args - input_args: "" - # - Optional: stream specific output args - output_args: - detect: "" - record: "" - rtmp: "" - # -- Optional: camera specific global args - global_args: "" - # -- Optional: camera specific hwaccel args - hwaccel_args: "" - # -- Optional: camera specific input args - input_args: "" - # -- Optional: camera specific output args - output_args: - detect: "" - record: "" - rtmp: "" - # -- Optional: timeout for highest scoring image before allowing it - # - to be replaced by a newer image. - best_image_timeout: 60 - # -- Optional: zones for this camera - zones: - # -- Required: name of the zone - # - NOTE: This must be different than any camera names, but can match with another zone on another camera - - name: front_steps - # -- Required: List of x,y coordinates to define the polygon of the zone. - # - NOTE: Presence in a zone is evaluated only based on the bottom center of the objects bounding box. - coordinates: 545,1077,747,939,788,805 - # -- Optional: List of objects that can trigger this zone (default: all tracked objects) - objects: [] - # - person - # -- Optional: Zone level object filters. - # -NOTE: The global and camera filters are applied upstream. - filters: [] - # - object: person - # min_area: null - # max_area: null - # threshold: "" - # -- Optional: Configuration for the jpg snapshots published via MQTT - mqtt: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Enable publishing snapshot via mqtt for camera - # - NOTE: Only applies to publishing image data to MQTT via 'frigate///snapshot'. - # - All other messages will still be published. - enabled: true - # -- Optional: print a timestamp on the snapshots - timestamp: true - # -- Optional: draw bounding box on the snapshots - bounding_box: true - # -- Optional: crop the snapshot - crop: true - # -- Optional: height to resize the snapshot to - height: null - # -- Optional: jpeg encode quality - quality: null - # -- Optional: Restrict mqtt messages to objects that entered any of the listed zones - required_zones: [] - # -- Optional: Configuration for how camera is handled in the GUI. - ui: - # -- Enable it to add the configuration in the config file - render_config: false - # -- Optional: Adjust sort order of cameras in the UI. Larger numbers come later - # - By default the cameras are sorted alphabetically. - order: null - # -- Optional: Whether or not to show the camera in the Frigate UI - dashboard: true ingress: rtmp: @@ -454,17 +67,14 @@ persistence: media: enabled: true mountPath: /media - db: - enabled: true - mountPath: /db - frigate-config: - enabled: true + config: + # Only enable when not using frigateConfig + enabled: false mountPath: /config - type: configmap - objectName: frigate-config - items: - - key: config.yml - path: config.yml + targetSelector: + main: + main: {} + init-config: {} portal: open: