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://github.com/truecharts/charts/tree/master/charts/stable/frigate
- https://ghcr.io/blakeblackshear/frigate - https://ghcr.io/blakeblackshear/frigate
type: application type: application
version: 14.0.0 version: 14.0.1

View File

@ -2,11 +2,10 @@
{{- define "frigate.configmap" -}} {{- define "frigate.configmap" -}}
enabled: true enabled: true
data: data:
{{- if .Values.frigateConfig }}
config.yml: | config.yml: |
{{- if .Values.frigateConfig }}
{{- .Values.frigateConfig | toYaml | nindent 4 }} {{- .Values.frigateConfig | toYaml | nindent 4 }}
{{- else }} {{- else }}
config.yml.dummy: |
mqtt: mqtt:
enabled: false enabled: false
cameras: cameras:
@ -21,22 +20,24 @@ data:
{{- end -}} {{- end -}}
{{- define "frigate.configVolume" -}} {{- define "frigate.configVolume" -}}
{{- $mountPath := "/dummy-config/config.yml" -}}
{{- if .Values.frigateConfig }}
{{- $mountPath = "/config/config.yaml" -}}
{{- end }}
enabled: true enabled: true
type: configmap type: configmap
objectName: frigate-config objectName: frigate-config
targetSelector:
main:
main: {}
init-config: {}
{{- if .Values.frigateConfig }}
mountPath: /config
items: items:
- key: config.yml - key: config.yml
path: config.yml path: config.yml
{{- else }} targetSelector:
mountPath: /dummy-config main:
items: main:
- key: config.yml.dummy subPath: config.yml
path: config.yml.dummy mountPath: {{ $mountPath }}
{{- end -}} readOnly: true
init-config:
subPath: config.yml
mountPath: {{ $mountPath }}
readOnly: true
{{- end -}} {{- end -}}

View File

@ -7,11 +7,6 @@
{{- $_ := set .Values.configmap "frigate-config" $config -}} {{- $_ := set .Values.configmap "frigate-config" $config -}}
{{- end -}} {{- end -}}
{{- if .Values.frigateConfig -}}
{{- $_ := set .Values.persistence.modelcache "enabled" true -}}
{{- else }}
{{- $_ := set .Values.persistence.config "enabled" true -}}
{{- end -}}
{{- $vol := include "frigate.configVolume" . | fromYaml -}} {{- $vol := include "frigate.configVolume" . | fromYaml -}}
{{- if $vol -}} {{- if $vol -}}

View File

@ -6,6 +6,7 @@ tensorrtImage:
repository: ghcr.io/blakeblackshear/frigate repository: ghcr.io/blakeblackshear/frigate
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 0.13.2-tensorrt@sha256:07cc224cdf2feef0af9c860c044ac7ea0ac4adfca7f68b37dc3958bc3a3ee357 tag: 0.13.2-tensorrt@sha256:07cc224cdf2feef0af9c860c044ac7ea0ac4adfca7f68b37dc3958bc3a3ee357
# When this is defined, the contents will be mounted # When this is defined, the contents will be mounted
# as configmap into the container at /config/config.yml. # as configmap into the container at /config/config.yml.
frigateConfig: {} frigateConfig: {}
@ -36,15 +37,19 @@ workload:
mkdir -p /config mkdir -p /config
if [ ! -f /config/config.yml ]; then if [ ! -f /config/config.yml ]; then
echo "Config file not found, copying dummy..." 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" 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 fi
securityContext: securityContext:
container: container:
readOnlyRootFilesystem: false readOnlyRootFilesystem: false
runAsNonRoot: false runAsNonRoot: false
runAsUser: 0 runAsUser: 0
runAsGroup: 0 runAsGroup: 0
service: service:
main: main:
ports: ports:
@ -78,24 +83,19 @@ service:
port: 8555 port: 8555
protocol: udp protocol: udp
targetPort: 8555 targetPort: 8555
persistence: persistence:
media: media:
enabled: true enabled: true
mountPath: /media mountPath: /media
config: config:
# Only enable when not using frigateConfig enabled: true
enabled: false
mountPath: /config mountPath: /config
targetSelector: targetSelector:
main: main:
main: {} main: {}
init-config: {} init-config: {}
modelcache:
# Only enable when using frigateConfig
enabled: false
mountPath: /config/model_cache
portal: portal:
open: open:
enabled: true enabled: true
updated: true