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

hip introducing export-values for better composability #242

Merged
merged 4 commits into from
Nov 3, 2022

Conversation

c0d1ngm0nk3y
Copy link
Contributor

Composing Helm charts using dependencies is currently limited because it is not possible to create a chart with a defined set of values and distribute them to subcharts.

This hip proposes an export-values structure to address this issue.

@helm-bot helm-bot added the size/L label Feb 4, 2022
Co-authored-by: Johannes Dillmann <[email protected]>
Co-authored-by: Ralf Pannemans <[email protected]>
Co-authored-by: Pavel Busko <[email protected]>
Co-authored-by: Jan von Löwenstein <[email protected]>
Co-authored-by: Philipp Stehle <[email protected]>
Co-authored-by: I546443 <[email protected]>
Signed-off-by: Ralf Pannemans <[email protected]>
@c0d1ngm0nk3y
Copy link
Contributor Author

@hickeyma , @marckhouzam HI. Is there anything missing? It would be great to get some feedback for this HIP, but we cannot add reviewers. What is the preferred approach?

@c0d1ngm0nk3y
Copy link
Contributor Author

Would really be great to get any reaction at all. Is the HIP still used at all?

@roulettedares
Copy link

It's currently next to impossible to use the parent - subchart pattern with the helmfile values that jenkins-x passes to each release. This would unblock me in that scenario and also enable me to make a bunch of my other chart values way more DRY.

@bridgetkromhout
Copy link
Member

Discussion in March 17, 2022 helm developer call: https://docs.google.com/document/d/1d-6xJEx0C78csIYSPKJzRPeWaHG_8W1Hjl72OJggwdc/edit?usp=sharing

@marckhouzam
Copy link
Member

Looks like the next available number for a HIP is "0016". @c0d1ngm0nk3y you can replace the "9999" with "0016" in the file and in the name of the file.

Signed-off-by: Philipp Stehle <[email protected]>
@phil9909
Copy link
Contributor

Looks like the next available number for a HIP is "0016". @c0d1ngm0nk3y you can replace the "9999" with "0016" in the file and in the name of the file.

Done

Co-authored-by: Sumit Kulhadia <[email protected]>
Signed-off-by: Ralf Pannemans <[email protected]>
@loewenstein
Copy link
Contributor

@jdolitsky anything missing to get this HIP merged?

Copy link
Contributor

@mattfarina mattfarina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some concerns about backwards compatibility. How will older Helm clients handle this situation? Older versions are widely in use.

hips/hip-0016.md Outdated

## Backwards Compatibility

This change won't break any existing Helm chart since it only adds new mechanisms.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will older Helm clients (e.g. v3.6.2) work with charts generated with these properties. Older versions of Helm are in wide use.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed a tricky problem.
My first idea was: We need to bump the apiVersion of the Chart.yaml and make the feature only available, if the newer version is used. But I noticed that my local helm installation happily templates my dummy chart, even if I set apiVersion: v100 in the Chart.yaml (which IMHO is a bug).

One alternative I see is recommending to chart authors who use the feature (in the docs of that feature) to include something like this in their templates (maybe in min-version.yaml by convention):

{{- if semverCompare ">3.10.0" .Capabilities.HelmVersion.Version }}
{{- fail "This chart requires helm version 3.10.0 or higher" }}
{{- end }}

3.10.0 is obviously only a placeholder for whatever version we will include this in.

Another way could be to make it only available, if you target a Kubernetes version to high for older helm versions (as defined in Supported Version Skew) by setting kubeVersion in the Chart.yaml. But this would be rather hard to document and I also don't think that the helm cli enforces this in any way. But at least it is documented as "not recommended" for a long time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about introducing a new function minimumHelmVersion?
The export-values would be only avilalbe, if you called minimumHelmVersion with 3.10.0 or higher.

That way, people using an older version of helm would get an error message function "minimumHelmVersion" not defined which should be a good hint that they might need to upgrade their helm version.

This approach could allow other changes, that couldn't otherwise be delivered in a backwards compatible way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

child: "serverPort"
- name: server
version: 1.0.0
export-values:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will older versions of Helm (e.g., v3.6.2) handle running into this? What will the chart do if someone tries to install it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matt good point. See my suggestion here #242 (review)

@phil9909
Copy link
Contributor

@jdolitsky anything missing to get this HIP merged?

HIPs need two approvals to get merged

klueska added a commit to NVIDIA/k8s-device-plugin that referenced this pull request May 26, 2022
This is a bit unorthodox because (logically) the gfd daemonset template should
live inside the gfd chart. However, there is currently no good way to pass
values from a parent chart into a subchart without jumping through alot of
undesirabe hoops. This makes it hard to support the new shared config we have
between gfd and the plugin.

By moving the gfd daemonset into the plugin chart, we now have the ability to
share values from the plugin into gfd. Note, that we don't move the contents of
the values.yml from the gfd subchart into the plugin's values.yml. This is done
on purpose, so that once proper suppport is in place to share values from a
parent to a subchart, there won't be much work to move this file back where it
belongs. A subsequent commit will show how we access these subchart values from
gfd.yml, such that minimal code changes will be needed once we move gfd.yml
back into the subchart.

Below is a link to the Helm Improvement Proposal (HIP) that (once available)
will allow us to move gfd.yml back where it belongs:

helm/community#242

Signed-off-by: Kevin Klues <[email protected]>
Copy link
Member

@scottrigby scottrigby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I met with @phil9909 to better understand the use case, and now I see the value here beyond requiring users of parent charts to specify the same value over and over in the way that child charts require. This is essentially a mapping function that does the reverse of import-values. Phiiip, would you please write up the use case with the personas you mentioned? It would be faster for you to do this than for me right now.

I just have one suggestion for the HIP backwards compatibility section below, which addresses concerns @mattfarina mentioned. Otherwise, I think this looks good!

hips/hip-0016.md Outdated Show resolved Hide resolved
Signed-off-by: Philipp Stehle <[email protected]>
Co-authored-by: Pavel Busko <[email protected]>
Co-authored-by: Scott Rigby <[email protected]>
Copy link
Member

@scottrigby scottrigby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking good now for merging as a draft HIP 👍

@mattfarina How is this looking from your side? I think this has been addressed now in the HIP.

@loewenstein
Copy link
Contributor

With two approvals (from @scottrigby & @jdolitsky) and @mattfarina's comments supposedly addressed, could we maybe proceed and try to get this HIP merged soon and the implementation into 3.11.0?

3.11.0 is the next feature release and will be released on January 18, 2023

@scottrigby scottrigby merged commit 0158df7 into helm:main Nov 3, 2022
@pbusko pbusko deleted the hip-export-values-reviewed branch November 4, 2022 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants