projectsveltos / addon-controller

Sveltos Kubernetes add-on controller programmatically deploys add-ons and applications in tens of clusters. Support for ClusterAPI powered clusters, Helm charts, kustomize ,YAMLs. Sveltos has built-in support for multi-tenancy.
https://projectsveltos.github.io/sveltos/
Apache License 2.0
222 stars 14 forks source link

feat: post-render patches #595

Open oliverbaehler opened 1 week ago

oliverbaehler commented 1 week ago

Is your feature request related to a problem? Please describe. One feature i have used the most in combination with FluxCD is the option to change values of a helm chart via Kustomize-Patches, see the following:

I was wondering how much interest is there to implement this.

Describe the solution you'd like

Add for Helm-Charts (or maybe scoped to the entire Profile?) The option to enter kustomize patches. We should probably add the functionality that we can use sprig templating within the patches definition, because in most use-cases you probably want to patch cluster-specific stuff on charts.

gianlucam76 commented 3 days ago

Thank you for proposing this @oliverbaehler. This would be a lovely addition.

I see Helm SDK supports this, so all that is needed is to extend ClusterProfile/Profile helm section. Eventually instantiate it using management cluster resources. Finally set installClient.PostRenderer and upgradeClient.PostRenderer

type PostRenderer interface {
    // Run expects a single buffer filled with Helm rendered manifests. It
    // expects the modified results to be returned on a separate buffer or an
    // error if there was an issue or failure while running the post render step
    Run(renderedManifests *bytes.Buffer) (modifiedManifests *bytes.Buffer, err error)
}

Do you want to look into this? Otherwise I won't mind taking care of it. Thank you!