-
Notifications
You must be signed in to change notification settings - Fork 710
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
Helm: Kubeapps doesn't consider the default values set from the chart #4803
Comments
From slack: yes,
Thanks for the extra information. Yes, I agree - the Kubeapps validation of the user values should take into account the default values that are not set, rather than relying on the (Kubeapps UI only) default values all being set in the deploy explicitly. |
I've just upgraded to the latest version:
but I'm still experiencing this issue. |
Mmm, will check during the next iteration. I thought it got solved :S |
I've been trying to reproduce the issue, but I haven't been able to in charts whose schemas do not use any As you mentioned, "If the chart schema enforces the presence of all the values, then Kubeapps complains that the values aren't valid" I assume the problem happens when hitting the backend. As we are just passing a subset of the values, Helm is going to complain about the values being given (as they lack some of the required ones). I don't see any quick-win solution here, unfortunately. I mean, now we display both the deployed/pkg default values, you could just revert those changes you want back manually, like: Can you think of any other alternative? |
On the charts I maintain I'm used to write an exhaustive schema mentioning all the values and, since a default value will always be provided by the chart, to mark them all as required. The benefit of this policy is to prevent the user from setting invalid Helm values, stemming from a typo for example. We don't have an exclusive Kubeapps-centric usage for deploying a Helm chart as you seem to have in mind, on some cases the deployment may be sparked off Helm CLI and then managed from Kubeapps. So I think this issue is quite relevant for people having a restricted Helm schema and mixing Kubeapps and third-party mechanisms. I expect Kubeapps to behave similarly than Helm : it should merge the default values set from the chart with the ones provided by the user and not expect the user to always specify the comprehensive Helm values. |
In addition to expecting Kubeapps to behave similar to Helm regarding the validation of values passed during install, we may also want to update Kubeapps to behave similar to Helm regarding the values stored in the release on install:
We may instead want to ensure that Kubeapps passes to Helm just the values set by the user, so it behaves in the same way later (ie. helm assumes values have been set explicitly by user if included, which affects changing values on upgrade). In the past we couldn't do this as it would have meant that the user doesn't see all the other knobs in the values on upgrade (as per the screenshot above where the chart was deployed by Helm first), but that's also solveable I think? Anyway, just food for thought. |
Signed-off-by: Michael Nelson <minelson@vmware.com> <!-- Before you open the request please review the following guidelines and tips to help it be more easily integrated: - Describe the scope of your change - i.e. what the change does. - Describe any known limitations with your change. - Please run any tests or examples that can exercise your modified code. Thank you for contributing! --> ### Description of the change <!-- Describe the scope of your change - i.e. what the change does. --> Updates the `validateValuesSchema` function to additionally use the package default values, when specified, so that user values will be confirmed as valid even if they don't set certain values that are required by the schema but have default values specified by the package. ### Benefits <!-- What benefits will be realized by the code change? --> Enables the scenario outlined by @dud225 in #4803, where a helm chart is deployed via the Helm CLI, rather than Kubeapps, and so the values set by the user are only those actually set by the user (as opposed to when deployed with Kubeapps where we currently incorrectly send all the default values as user-set values - I may open a separate issue for that, depending on a few things). ### Possible drawbacks <!-- Describe any known limitations with your change --> ### Applicable issues <!-- Enter any applicable Issues here (You can reference an issue using #) --> - fixes #4803 ### Additional information <!-- If there's anything else that's important and relevant to your pull request, mention that information here.--> I've not yet tested this IRL to ensure it fixes the scenario in the issue, but will do so tomorrow. Signed-off-by: Michael Nelson <minelson@vmware.com>
Describe the bug
When using Kubeapps to manage a Helm deployment that has been previously installed outside of it and for which only a subset of the values were specified (relying on the default values set from the chart for the others), Kubeapps only takes into consideration the values set at installation time.
To Reproduce
Expected behavior
Kubeapps should merge the default values set from the chart with the ones set by the user.
Screenshots

Kubeapps only considers the values set from the user:
If the chart schema enforces the presence of all the values, then Kubeapps complains that the values aren't valid:

Versions:
The text was updated successfully, but these errors were encountered: