Skip to content

[ Helm ] Allow user to provide additional volumes and volumemounts #3728

@Anghille

Description

@Anghille

Problem statement
In the helmChart, when an ops wants to configure non-root / read-only pods to follow best practices, 2 modules complains about readonly filesystem: matplotlib and fontconfig.

Unfortunately, there is no way to add emptyDir or additional pvcs that we could mount in the expected paths for matplotlib or fontconfig, so they can write data properly, nor do they respect the variable MPLCONFIGDIR or FONTCONFIG_CACHE to make them write stuff at an already writable path (like /code or /tmp).

I am not sure what the impact is, but we can see lots of logs about this such as:

backend Fontconfig error: No writable cache directories
backend Fontconfig error: No writable cache directories
backend Fontconfig error: No writable cache directories
backend Fontconfig error: No writable cache directories
huey mkdir -p failed for path /.config/matplotlib: [Errno 30] Read-only file system: '/.config'
huey Matplotlib created a temporary cache directory at /tmp/matplotlib-uhy8i1hb because there was an issue with the default path (/.config/matplotlib); it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
huey Fontconfig error: No writable cache directories
huey Fontconfig error: No writable cache directories

proposal

The idea of the proposal would be to

  1. Allow users to setup additional volumes and volumemounts in the helmchart. this is standard practice in the kubernetes world, something along those lines:
backend:
  # existing fields...
  
  # NEW
  extraVolumes: []
    # example
    #- name: ca-certs
    #      secret:
    #        secretName: my-ca-cert
  extraVolumeMounts: []
    # example
    #- name: ca-certs
    #  mountPath: /usr/local/share/ca-certificates/custom-ca.crt
    #  subPath: ca.crt
    #  readOnly: true

  huey:
    # existing fields...
    # NEW
    extraVolumeMounts: []

frontend:
  # existing fields...

  # NEW
  extraVolumes: []
  extraVolumeMounts: []

And this would be easily added to the chart templates with templates in the likes of:

        {{- with .Values.backend.extraVolumeMounts }}
          {{- toYaml . | nindent 8 }}
        {{- end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions