kubernetes-helmkubernetes-ingressnginx-ingresshelmfile

Helmfile with additional resource without chart


I know this is maybe a weird question, but I want to ask if it's possible to also manage single resources (like f.e. a configmap/secret) without a seperate chart?

F.e. I try to install a nginx-ingress and would like to additionally apply a secret map which includes http-basic-authentication data.

I can just reference the nginx-ingress-repo directly in my helmfile, but do I really need to create a seperate helm chart to also apply the http-basic-secret?

I have many releases which need a single, additional resource (like a json configmap, a single secret) and it would be cumbersome to always need a seperate chart file for each release?

Thank you!


Solution

  • Sorry, Helmfile only manages entire Helm releases.

    There are a couple of escape hatches you might be able to use. Helmfile hooks can run arbitrary shell commands on the host (as distinct from Helm hooks, which usually run Jobs in the cluster) and so you could in principle kubectl apply a file in a hook. Helmfile also has some integration with Kustomize and it might be possible to add resources this way. As you've noted you can also write local charts and put whatever YAML you need in those.

    The occasional chart does support including either arbitrary extra resources or specific configuration content; the Bitnami MariaDB chart, to pick one, supports putting anything you want under an extraDeploy value. You could use this in combination with Helmfile values: to inject more resources

    releases:
      - name: mariadb
        chart: bitnami/mariadb
        values:
          - extraDeploy:
              - |-
                  apiVersion: v1
                  kind: ConfigMap
                  ...