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

Add PersistentClient flag to allow control over Kubernetes client behavior #659

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Mar 30, 2023

This adds a PersistentClient flag to the HelmRelease to allow control over the behavior of the Kubernetes client used by Helm actions.

When enabled, the client will be reused for the duration of the reconciliation, instead of being created and destroyed for each (step of a) Helm action. This can improve performance (see #630), but may cause issues with some Helm charts (as reported in #655) that for example do create Custom Resource Definitions during installation outside Helm's CRD lifecycle hooks, which are then not observed to be available by e.g. post-install hooks.

If not set, it defaults to true. Making this effectively an opt-out.


Addresses option two from #655 (comment)

@hiddeco hiddeco added enhancement New feature or request area/helm Helm related issues and pull requests labels Mar 30, 2023
@hiddeco hiddeco force-pushed the flag-persistent-client branch 2 times, most recently from 0fc0844 to 71bc8af Compare March 30, 2023 12:30
@hiddeco hiddeco marked this pull request as ready for review March 30, 2023 12:48
Copy link
Member

@makkes makkes left a comment

Choose a reason for hiding this comment

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

just a nit, otherwise lgtm

api/v2beta1/helmrelease_types.go Show resolved Hide resolved
Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

LGTM!

This adds a `PersistentClient` flag which should be consumed by the
controller while initializing the Kubernetes client used by Helm
actions.

This to allow the controller to work with certain charts which do
require a client which does not persist, as they create Custom Resource
Definitions on demand during e.g. install, which then later aren't
observed by Helm as it does not reset the REST mapper between successive
action steps.

Signed-off-by: Hidde Beydals <[email protected]>
@hiddeco hiddeco merged commit 4009fb6 into main Mar 30, 2023
@hiddeco hiddeco deleted the flag-persistent-client branch March 30, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Helm related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants