companyinfo / helm-charts

Company.info Helm charts repository
https://companyinfo.github.io/helm-charts
Apache License 2.0
68 stars 22 forks source link

resources included only when defined in direct Helm values #29

Closed alexfouche closed 10 months ago

alexfouche commented 11 months ago

Maybe this is on purpose, but it does not make sense to me

Context:

I am writing an Helm chart mychart, which as a dependency uses Helmet besides Redis Helm chart for example. So in the mychart/values.yaml (which acts as the defaults) of my Helm chart, i set all the top level values that Helmet expects, for example:

mychart/Chart.yaml:

(...)
name: mychart
dependencies:
  - name: redis
    repository: https://charts.bitnami.com/bitnami
    version: 18.1.1
  - name: helmet
    version: 0.9.1
    repository: https://companyinfo.github.io/helm-charts
    import-values: # <== It is mandatory if you want to import the Helmet default values.
      - defaults
  - name: common
    version: 2.x.x
    repository: "https://charts.bitnami.com/bitnami"
    tags:
      - bitnami-common

mychart/values.yaml:

image:
  repository: nginx

extraVolumes:
  - name: tmp
    emptyDir: {}

extraVolumeMounts:
  - name: tmp
    mountPath: /opt/plugandwork/apps/rce/current/tmp

These should act as the defaults, so i do not have to give any values when i run helm install mychart

Problem:

Helmet does not create any Deployment, nor Volumes in the Deployment config

To make it work, i have to remove the settings from mychart/values.yaml and set them into a top level myvalues.yaml file given to Helm with helm install --values myvalues.yaml mychart

To my understanding, this makes Helmet quite unusable for more complex apps written on other dependency Helm charts

Or maybe i am using Helmet wrong, if then what is the correct way ?

atkrad commented 11 months ago

Hey @alexfouche, Did you include app template?

# file: templates/app.yaml

{{ include "helmet.app" . }}

It seems your Helm chart likes this example chart (https://github.com/companyinfo/helm-charts/tree/main/charts/helmet/examples/simple) right?

zevisert commented 11 months ago

I think this is due to helm v3.13 and not with hemet - @alexfouche which version of helm are you using?

I'm tracking what is I think the same problem as you in helm/helm#12460

atkrad commented 11 months ago

@zevisert Thank you.

It seems that this pull request, https://github.com/helm/helm/pull/12480, fixes the issue. I believe it will be included in the upcoming release, v3.13.1.

zevisert commented 11 months ago

Looks like helm/helm#12480 moved pretty quickly, it's been released as 3.13.1 just now