Replies: 2 comments 1 reply
-
@asafhm thank you so much for the level of effort and detail that you've put into exploring this topic. I think you're on the right track with the third option, and I've got some small ideas to improve it further and to mitigate your valid concern:
I'll follow up on this in the coming week. Thanks again for starting this convo! |
Beta Was this translation helpful? Give feedback.
-
Another caveat for those thinking of going with the third option - being dependent on Kargo for rendering your apps can pose a challenge when attempting to implement ephemeral/preview environments, as you now need to take care of setting up |
Beta Was this translation helpful? Give feedback.
-
The purpose of this thread is to see how users of Kargo who also prefer to render their applications using a combination of Helm+Kustomize do so.
I chose to focus on cases where we don't manage the underlying chart files, much like 3rd party charts, since this is where I found things become tricky.
To get it out of the way first, I believe combining Helm with Kustomize is an extremely powerful technique, as none of these tools alone quite brought me all the way to the finish line satisfactorily.
To me, here's what I'd expect out of the ideal solution:
Let's assume this is our repo layout:
Honestly, the only reasonable candidate I found that will let me harness Helm and Kustomize together is the
helmCharts
inflator in Kustomize. The question is where to place it... here are 3 possible options:1.
<addon>/base/kustomization.yaml
:e.g.
The problem is that you no longer retain the ability to override the values of that chart in your stages' kustomize files, and that's sadly because of how that directive is implemented. This is off the table then.
2.
<addon>/stages/<stage>/kustomization.yaml
:e.g.
This approach requires me to put the
helmCharts
block in each of my stages' files. That's obviously not DRY.Moreover, promotion of charts' versions becomes a whole thing now, since the
helmCharts
declaration is managed in each stage individually, they don't necessarily share the same version code-wise. That makes me have to awkwardly progress each on its own in thekustomization.yaml
files, without benefiting from the progressive process Kargo has for these cases.3. Like the first option, but with Kargo involved...
Full disclosure, I didn't try this, but in theory this could work -
We use the first approach, but we make sure to add a step in our Kargo
Stage
to surgically inject theadditionalValuesFiles
part into ourkustomization.yaml
before we runkustomize-build
.Something like this:
That can let us overcome
helmCharts
shortcoming of overriding values when using more than onekustomization.yaml
file, and also share the chart version across multiple stages, as thehelmCharts
definition is written once, in the base directory.The only downside I see for this approach is that it's not trivial for kustomize users, as now part of the logic for rendering these manifests sits elsewhere, in Kargo files, which perhaps are stored in a different repository altogether.
Please share your thoughts and how you approach this.
Beta Was this translation helpful? Give feedback.
All reactions