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

Allow users to add extra objects and resources when installing a Helm chart #12653

Open
wallrj opened this issue Dec 18, 2023 · 10 comments
Open
Labels

Comments

@wallrj
Copy link

wallrj commented Dec 18, 2023

In cert-manager/cert-manager#5900 @pierluigilenoci and I have been discussing whether it is sustainable for each Helm chart to implement its own values.extraObjects field.
Judging by the number of popular charts that have added extraObjects, this is clearly a needed feature.

Some use cases are:

  1. Platform team deploying cert-manager using Helm want to bundle some CNI manifests (e.g. Calico variant of NetworkPolicy) so that those cert-manager specific policies can be maintained alongside the cert-manager settings and uninstalled along with cert-manager.
  2. Platform team deploying cert-manager using Helm, want to bundle ConfigMaps containing Grafana dashboards for monitoring cert-manager. "It makes sense that all Grafana dashboards related to cert-manager are installed with the chart of the software itself without having to resort to external means.".

I think this should be implemented in Helm, probably as a helm install command line option, for the following reasons:

  1. It should be a more maintainable to implement helm install --user-supplied-manifests extra-objects/, than to add Values.extraObjects to each Helm chart.
  2. It should be more consistent to implement helm install --user-supplied-manifests extra-objects/, than for each Helm chart to implement the feature slightly differently
  3. It should be more user friendly to document helm install --user-supplied-manifests extra-objects/ thoroughly at helm.sh, than to document it (or not document it) chart-by-chart in the chart README file, for example.
  4. It should be more time efficient to discuss and plan this feature at https://github.com/helm/helm/, than to repeat the discussion with the maintainers of every Helm chart.

Links of interest, in no particular order:

Originally posted by @wallrj in #7077 (comment)

@mattfarina
Copy link
Collaborator

Before I dig in further, why wouldn't the extra objects be a second chart someone installs that add those?

Consider package managers for other platforms (like Linux) installing something like PHP or ffmpeg. For the "additional" parts there are secondary packages one would install. Why wouldn't that same style experience be followed?

@wallrj
Copy link
Author

wallrj commented Dec 20, 2023

Before I dig in further, why wouldn't the extra objects be a second chart someone installs that add those?

My understanding is that users find it laborious to create and maintain a second chart.
They prefer the extraObjects approach because it is less effort and because it has become a familiar pattern in other charts.
All the Bitnami charts have this option, for example.

There is an example of this in traefik/traefik-helm-chart#595 (comment) and apache/couchdb-helm#72 (comment) where @colearendt wrote:

In many cases, it can avoid the need for additional (fake helm chart w/ a few resources), extended (chart that extends the traefik chart), or adhoc deployments (kubectl apply and friends).

@pierluigilenoci
Copy link

@wallrj, you forgot to mention this: fluent/helm-charts#331 😉

@stevehipwell
Copy link

I think that Helm is currently lacking documentation & conventions (and maybe some tooling) to correctly separate the various roles who interact with it; this has led to charts trending towards having fewer constraints and being less opinionated. The addition of the extraObjects pattern in public Helm charts is a prime example of this direction of travel. I think this is a case of convenience over correctness as the documented pattern for this functionality is using public charts as sub-charts with additional resources strongly typed.

This said I can see value in adding native Helm support for rendering external templates as part of a chart install. I think the wrapper chart pattern is a better solution but anything to help move away from the extraObjects pattern would be a step in the right direction.


IMHO a public Helm chart (for a component) should aim to be as opinionated as possible while following the open-closed principal.

@pierluigilenoci
Copy link

@wallrj Also, this is related kubernetes/autoscaler#5633

@wallrj
Copy link
Author

wallrj commented Mar 6, 2024

Before I dig in further, why wouldn't the extra objects be a second chart someone installs that add those?

@mattfarina are you persuaded by the reasons given in the comments above?

@pierluigilenoci
Copy link

New use case: kubernetes/ingress-nginx#11351 (Always me 😛)

Copy link

github-actions bot commented Aug 7, 2024

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Aug 7, 2024
@pierluigilenoci
Copy link

This feature is still needed.

@github-actions github-actions bot removed the Stale label Aug 8, 2024
@pierluigilenoci
Copy link

Another addition to the topic: kubernetes/autoscaler#7243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants