Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
reefland opened this issue Mar 5, 2023 · 1 comment

Comments

@reefland
Copy link

reefland commented Mar 5, 2023

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.

@reefland
Copy link
Author

reefland commented Mar 5, 2023

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

@reefland reefland closed this as completed Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant