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

[FR] Allow the Chart to create extra manifest #5900

Closed
pierluigilenoci opened this issue Mar 29, 2023 · 16 comments · Fixed by #6424
Closed

[FR] Allow the Chart to create extra manifest #5900

pierluigilenoci opened this issue Mar 29, 2023 · 16 comments · Fixed by #6424
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@pierluigilenoci
Copy link

pierluigilenoci commented Mar 29, 2023

Is your feature request related to a problem? Please describe.

Sometimes, accessories to the installation may be manifests to be installed (for example, a SecretProviderClass or Certificates).

Describe the solution you'd like

It would be nice to be able to do this directly via the Chart using the approach that Grafana, Prometheus or OAuth2 Proxy also uses.

Describe alternatives you've considered

I don't think there are alternatives

Additional context

No additional context

/kind feature

@jetstack-bot jetstack-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 29, 2023
@jetstack-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle stale

@jetstack-bot jetstack-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 27, 2023
@pierluigilenoci
Copy link
Author

/remove-lifecycle stale

@jetstack-bot jetstack-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 27, 2023
@jetstack-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle stale

@jetstack-bot jetstack-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 25, 2023
@pierluigilenoci
Copy link
Author

/remove-lifecycle stale

@jetstack-bot jetstack-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 26, 2023
@wallrj
Copy link
Member

wallrj commented Oct 18, 2023

@pierluigilenoci and @gplessis Please supply some concrete use cases for this feature.

I don't think Certificate can be among the extraManifests because that's a cert-manager CRD which will only be usable after the cert-manager CRDs have been installed and after the validating webhook has been deployed and is ready.

Please explain precisely why and how a SecretProviderClass would be deployed using this feature and explain why a Helm post install hook or another Helm chart or a set of pre-provisioned manifests would not also solve the problem for you.

https://cert-manager.io/docs/contributing/policy/#additional-configuration-options-for-the-helm-chart explains why we are reluctant to add new Helm chart features like this.

@pierluigilenoci
Copy link
Author

@wallrj, the most common use case might be to install a ClusterIssuer.
The CRD installation precedence could be resolved with #6193.
Another example could be to create ConfigMap to create dashboards in Grafana.
Or any other software manifest to monitor the cert-manager.

@wallrj
Copy link
Member

wallrj commented Oct 18, 2023

@wallrj, the most common use case might be to install a ClusterIssuer. The CRD installation precedence could be resolved with #6193.

I don't think that's a real example because even if the CRDs have already been installed, you can't create cert-manager custom resources (including ClusterIssuer) until the cert-manager webhook is ready. The explanation is here (although slightly out-of-date):

Another example could be to create ConfigMap to create dashboards in Grafana. Or any other software manifest to monitor the cert-manager.

Please be more precise about this use-case. Explain when, where and how Grafana gets installed. Explain why the ConfigMap isn't included in the Grafana chart. If we agree that the ClusterIssuer can not be included in the extraManifests of cert-manager, howdo you install those resources and why can't the grafana ConfigMap be installed in that way too?

@pierluigilenoci
Copy link
Author

@wallrj, the way I see things, an application should be installed and configured using a single "artifact" rather than multiple elements.
From this comes the interest in having a chart that allows you to configure everything necessary, including the accessory parts, such as the Grafana dashboards I want to use to observe the cert-manager.

Obviously, I could insert the ConfigMaps to load the dashboards using the Grafana chart, but I find it more intelligent if they are together with the application that concerns them.
This could reduce cluttering.
It makes no sense for all the software's dashboards to be installed via Grafana because not all are present in all the clusters.

And then, when and if Grafana is installed does not matter.
Cert-manager would still be installed with everything it needs.

At this moment, to do so, a chart umbrella must be used that has the cert-manager dependency and installs the extra files that can't be installed with the base chart.
Or installed separately via one of the GitOps tools on the market; it doesn't matter which one.

However, I have a question: do you have any technical reason to be against this change? Because even if the use cases are minimal, it is a modification that has little or no impact, it makes the chart more dynamic without causing any damage.

Note: the ClusterIssuer could be installed post-install while the cert-manager pod could be programmed to become ready only after the validating webhook configuration is up and running by doing post-install checks.

@wallrj
Copy link
Member

wallrj commented Oct 19, 2023

@wallrj, the way I see things, an application should be installed and configured using a single "artifact" rather than multiple elements. From this comes the interest in having a chart that allows you to configure everything necessary, including the accessory parts, such as the Grafana dashboards I want to use to observe the cert-manager.

Obviously, I could insert the ConfigMaps to load the dashboards using the Grafana chart, but I find it more intelligent if they are together with the application that concerns them. This could reduce cluttering. It makes no sense for all the software's dashboards to be installed via Grafana because not all are present in all the clusters.

And then, when and if Grafana is installed does not matter. Cert-manager would still be installed with everything it needs.

Ok. Thanks for taking time to explain. I guess that you use:

If this is how you want to use Helm, you should create a feature request in https://github.com/helm/helm i.e.

helm install cert-manager jetstack/cert-manager \
  --values cert-manager.values.yaml \
  --user-supplied-manifests cert-manager-grafana-dashboard.yaml

So that you can use this technique with any Helm chart.
Rather than having to persuade every Helm chart to add the extraManifests value.

At this moment, to do so, a chart umbrella must be used that has the cert-manager dependency and installs the extra files that can't be installed with the base chart. Or installed separately via one of the GitOps tools on the market; it doesn't matter which one.

Those all sound like good solutions to this problem.
I would add

However, I have a question: do you have any technical reason to be against this change? Because even if the use cases are minimal, it is a modification that has little or no impact, it makes the chart more dynamic without causing any damage.

The impact is not minimal.
The maintainers get dozens of requests to add new parameters to the Helm chart.
these all require discussion.
All require documentation.
All require maintenance and testing.

A feature like this is likely to cause support requests because it will be natural for users to try and use it to install ClusterIssuer,
which we have agreed is not possible.

Note: the ClusterIssuer could be installed post-install while the cert-manager pod could be programmed to become ready only after the validating webhook configuration is up and running by doing post-install checks.

The cert-manager chart already has a post-install hook blocks until the cert-manager webhook is Ready.
Read about it here:

@pierluigilenoci
Copy link
Author

@wallrj, those ConfigMaps you linked from the Grafana documentation are precisely the ones I want to create as extra manifests from the cert-manager chart. It makes sense that all Grafana dashboards related to cert-manager are contained in the chart of the software itself without having to resort to external means.

I need to understand why I should ask for an additional feature in Helm to do something it already does—effectively complicating its use.

I don't need to persuade any Helm Chart maintainers. It is a good practice, which is, in fact, already used in many charts. So, I expect to find it already or hope that by requesting it, given the low impact of creating the PR to implement it, available maintainers will favorably embrace it.

The impact of implementation, documentation, and maintenance is so low that if you promise me a quick review and merge, I am willing to take on the effort (maximum 30 minutes of work).

Do you think Grafana or Prometheus maintainers are naive and open the gate to problems?

Suppose you are worried about someone using it to create ClusterIssuer. In that case, I can explicitly add, in the documentation for the option, that it is not recommended because it doesn't work (which, anyway, I would like to try because I'm not so convinced in light of #4234).

Why set up a more complex implementation when you can get a more straightforward solution for less?

@pierluigilenoci
Copy link
Author

@wallrj any feedback?

@wallrj
Copy link
Member

wallrj commented Nov 29, 2023

@pierluigilenoci Sorry for the radio silence.

I need to understand why I should ask for an additional feature in Helm to do something it already does—effectively complicating its use.

The alternative is to complicate every Helm chart instead.

It should be a more maintainable to implement helm install --user-supplied-manifests extra-objects/,
than to add Values.extraObjects to each Helm chart.

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

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.

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.

Having said that, after investigating the various NetworkPolicy implementations, it might have been easier for us to simply add extraObjects and give users the flexibility to add any extra manifests they like, than to implement special values and templates for NetworkPolicy, PodDisruptionBudget etc.

Links of interest, in no particular order:

@joebowbeer
Copy link
Contributor

I have noticed that some fairly simple helm charts do provide an "extra resources" section (helm/helm#7077) where users can add your own stuff.

But we use kustomize, if needed, to customize helm charts, so we rarely have need for this feature.

@jetstack-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
/lifecycle stale

@jetstack-bot jetstack-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 5, 2024
@gplessis
Copy link
Contributor

gplessis commented Apr 5, 2024

/remove-lifecycle stale

@jetstack-bot jetstack-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 5, 2024
@gplessis
Copy link
Contributor

gplessis commented May 7, 2024

This has been implemented in #6424

@wallrj wallrj linked a pull request May 7, 2024 that will close this issue
@wallrj wallrj closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@joebowbeer @gplessis @wallrj @jetstack-bot @pierluigilenoci and others