-
Notifications
You must be signed in to change notification settings - Fork 159
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
Ability to preserve apps individuality in a monorepo after kustomize-build #3154
Comments
Is there a reason you can't just set the path on the kustomize-build step to be a path within the repo instead of the root of the repo? If it's just a matter of the possibility that the path doesn't exist, I think we could easily fix that by doing the programmatic equivalent of |
When I apply changes to the
Will this work when running the At this point, after struggling so much with this, I'm starting to wonder if my approach to monorepos is wrong at the core... |
I understand the end result you want, but my previous response was based on what I now think was a flawed understanding of your repo's layout. Let me look at this again with fresh 👀 in the morning. |
@krancour Much appreciated. |
If I understand correctly, you have a repository with one or more Kustomize overlays in a directory. You then use This is especially impractical because you want to render everything at once, but still have individual Applications manage a subset of the resources in Argo CD. For which having a separate file or directory is a requirement. The problem for us to solve here is that we do not have anything to trace the origin of a Kubernetes resource from the Kustomize build output at the time it is done building the resources, as Kustomize truncates this information before returning the final resources. One option I could see working is that we allow some annotation to be set on resources to define logical units, which we could then use to write things to sub-directories and/or files. |
@hiddeco My thoughts exactly. I hoped kustomize had some kind of psuedo-label/annotation that could help me output my resources to specific directories, but none such feature exists. |
Consider the following alternative file hierarchy, where each addon gets the full base+variants+env-specific details in its own directory:
The following assumptions will have to be made:
I can see this working, but it requires a lot of extra |
Checklist
kargo version
, if applicable.Proposed Feature
Given the following monorepo structure example:
After running
kustomize-build
, all manifests are outputed to a single file, or a file per manifest.When using the Rendered Manifests pattern, it would be great to have a way to control the output of this action (or maybe with a novel action) so that the final directory structure of an
env/prod
branch would look like this:Motivation
We gather more and more apps with time, and managing each in a dedicated repository sounds like a management nightmare.
This is why a monorepo sounds like a good pick for this case.
It would also make sense to use an
ApplicationSet
that generate the apps relevant for a specific env by using a the git generator for all directories in theenv/prod
branch. The problem is thatkustomize-build
doesn't let us control which directory we want to output some resources to.Perhaps I miss something big time, but I can't seem to find an example out there of how to harness Kargo with a monorepo approach that handles this simple requirement.
If there's some workaround, or a better structuring suggestion, please share.
Suggested Implementation
The text was updated successfully, but these errors were encountered: