fix(Frigate): Fix configmap for 0.13 (#18967)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ 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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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 <s.kois@outlook.com>
This commit is contained in:
StevenMcElligott 2024-03-10 07:49:36 -04:00 committed by GitHub
parent e86cbf224c
commit c6a7348da3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 28 deletions

View File

@ -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

View File

@ -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 -}}

View File

@ -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 -}}

View File

@ -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