onedr0p / home-ops

Wife approved HomeOps driven by Kubernetes and GitOps using Flux

Home Page:https://onedr0p.github.io/home-ops/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question on Frigate / app-template chart / using configMaps - file is mounted as directory

reefland opened this issue · comments

Modeling Frigate Deployment based on:
https://github.com/onedr0p/home-ops/blob/main/kubernetes/apps/default/frigate/app/helmrelease.yaml

I'm using ArgoCD instead of Flux, typically a simple conversion with Helm. The app-template chart is not as well documented yet, so I might have missed something specifically with configMaps.

Getting an error the config file is mounted as a directory:

Traceback (most recent call last):
  File "/usr/local/go2rtc/create_config.py", line 18, in <module>
    with open(config_file) as f:
IsADirectoryError: [Errno 21] Is a directory: '/config/config.yml'

My values.yaml section has this:

        persistence:
          config-file:
            enabled: true
            type: configMap
            name: frigate-configmap
            subPath: config.yaml
            mountPath: /config/config.yml
            readOnly: true

ArgoCD does add the prefix "frigate-", so the above name accounts for that.

And I have a configMaps section for the configmap.

        configMaps:
          configmap:
            enabled: true
            data:
              config.yml: |
                mqtt:
                  host: mosquitto-mqtt.mosquitto
                  user: "{FRIGATE_MQTT_USERNAME}"
                  password: "{FRIGATE_MQTT_PASSWORD}"
                  ...

Reviewing the resulting StatefulSet deployment, it has:

      volumeMounts:
        - mountPath: /config/config.yml
          name: config-file
          readOnly: true
          subPath: config.yaml
  volumes:
    - configMap:
        defaultMode: 420
        name: frigate-configmap
      name: config-file

Seems to be generated ok:

$ k describe cm frigate-configmap -n home-assistant

Name:         frigate-configmap
Namespace:    home-assistant
Labels:       app.kubernetes.io/instance=frigate
              app.kubernetes.io/managed-by=Helm
              app.kubernetes.io/name=frigate
              argocd.argoproj.io/instance=frigate
              helm.sh/chart=app-template-1.3.2
Annotations:  <none>

Data
====
config.yml:
----
mqtt:
  host: mosquitto-mqtt.mosquitto
  user: "{FRIGATE_MQTT_USERNAME}"
  password: "{FRIGATE_MQTT_PASSWORD}"
  ...

I couldn't find an example of app-template chart using a configMaps section within the values section of the Helm Release. I could only find external configMap being referenced. Wondering if this is a known issue? broken? It was pretty straight forward using it with k8s-at-home charts. The docs don't have a reference example yet.

OMG, as soon as I submit... the issue stands out... subPath: config.yml not subPath: config.yaml. Sorry to bother you.