From c6a7348da348215a0bf02d49e3bf97a0f5dadcd9 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Sun, 10 Mar 2024 07:49:36 -0400 Subject: [PATCH] fix(Frigate): Fix configmap for 0.13 (#18967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ 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:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 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 - [ ] ⬆️ 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 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._ --------- Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros kois --- charts/stable/frigate/Chart.yaml | 2 +- .../stable/frigate/templates/_configmap.tpl | 29 ++++++++++--------- charts/stable/frigate/templates/common.yaml | 5 ---- charts/stable/frigate/values.yaml | 16 +++++----- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/charts/stable/frigate/Chart.yaml b/charts/stable/frigate/Chart.yaml index 852bdd35b73..7f81f083198 100644 --- a/charts/stable/frigate/Chart.yaml +++ b/charts/stable/frigate/Chart.yaml @@ -36,4 +36,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/frigate - https://ghcr.io/blakeblackshear/frigate type: application -version: 14.0.0 +version: 14.0.1 diff --git a/charts/stable/frigate/templates/_configmap.tpl b/charts/stable/frigate/templates/_configmap.tpl index ebf25801a72..140aa24e075 100644 --- a/charts/stable/frigate/templates/_configmap.tpl +++ b/charts/stable/frigate/templates/_configmap.tpl @@ -2,11 +2,10 @@ {{- define "frigate.configmap" -}} enabled: true data: - {{- if .Values.frigateConfig }} config.yml: | + {{- if .Values.frigateConfig }} {{- .Values.frigateConfig | toYaml | nindent 4 }} {{- else }} - config.yml.dummy: | mqtt: enabled: false cameras: @@ -21,22 +20,24 @@ data: {{- end -}} {{- define "frigate.configVolume" -}} +{{- $mountPath := "/dummy-config/config.yml" -}} +{{- if .Values.frigateConfig }} + {{- $mountPath = "/config/config.yaml" -}} +{{- end }} 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 -}} +targetSelector: + main: + main: + subPath: config.yml + mountPath: {{ $mountPath }} + readOnly: true + init-config: + subPath: config.yml + mountPath: {{ $mountPath }} + readOnly: true {{- end -}} diff --git a/charts/stable/frigate/templates/common.yaml b/charts/stable/frigate/templates/common.yaml index 38e70f42807..2b554743aec 100644 --- a/charts/stable/frigate/templates/common.yaml +++ b/charts/stable/frigate/templates/common.yaml @@ -7,11 +7,6 @@ {{- $_ := set .Values.configmap "frigate-config" $config -}} {{- end -}} -{{- if .Values.frigateConfig -}} - {{- $_ := set .Values.persistence.modelcache "enabled" true -}} -{{- else }} - {{- $_ := set .Values.persistence.config "enabled" true -}} -{{- end -}} {{- $vol := include "frigate.configVolume" . | fromYaml -}} {{- if $vol -}} diff --git a/charts/stable/frigate/values.yaml b/charts/stable/frigate/values.yaml index 5baeac9c95e..77609964697 100644 --- a/charts/stable/frigate/values.yaml +++ b/charts/stable/frigate/values.yaml @@ -6,6 +6,7 @@ tensorrtImage: repository: ghcr.io/blakeblackshear/frigate pullPolicy: IfNotPresent tag: 0.13.2-tensorrt@sha256:07cc224cdf2feef0af9c860c044ac7ea0ac4adfca7f68b37dc3958bc3a3ee357 + # When this is defined, the contents will be mounted # as configmap into the container at /config/config.yml. frigateConfig: {} @@ -36,15 +37,19 @@ workload: 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 + cp /dummy-config/config.yml /config/config.yml echo "Config file copied, you can now edit it at /config/config.yml" + else + echo "Config file found, you can edit it at /config/config.yml" fi + securityContext: container: readOnlyRootFilesystem: false runAsNonRoot: false runAsUser: 0 runAsGroup: 0 + service: main: ports: @@ -78,24 +83,19 @@ service: port: 8555 protocol: udp targetPort: 8555 + persistence: media: enabled: true mountPath: /media config: - # Only enable when not using frigateConfig - enabled: false + enabled: true mountPath: /config targetSelector: main: main: {} init-config: {} - modelcache: - # Only enable when using frigateConfig - enabled: false - mountPath: /config/model_cache portal: open: enabled: true -updated: true