-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Produce individual yaml files instead of a single one #897
Comments
This feature would be useful when rolling up kustomize gradually, in order to replace the old-style (sed, etc.) automation around the yaml files. |
This is easy in the simple case you describe (which assumes a one resource per file input), but trickier in the cases of multi-layer overlays with multi- or remote bases, etc., where any file could contain N resources. Further, the direction we are going includes more resource generators - more resources that didn't start from a file artifact. The contribution in #929 is appreciated, but it touches lots of code, handles only a simple case and doesn't handle n resources from one file, directory trees with colliding file names, and it looks like generated objects end up in a file with an empty string name. There's no hierarchy in a k8s cluster (other than namespaces). The resources are all flat, and don't care that they came from some directory trees of from file blobs with n resources. They do, however, have unique group-version-kind-names. So if you're OK with not trying to retain any remnant of the original dir hierarchy, and could handle file names generated from GVKN, this gets lots simpler, e.g.
Would that work for your use case? |
Please reopen if you'd like to clarify this. |
I need to reproduce an exact file layout as it is needed for our purposes. |
Can we separate with kustomize few resources from a one file to different files by kind, like helm style ?
To generate two files, like
|
It seems we still can only use |
Dropping by to share my solution to this. You can use |
For our workflow, it would be needed to have the ability of producing the kustomize output into individual files, instead of just merging all the manifests together. So what we will need is that kustomize will take the initial list of files passed as resources, and composed the output into same matching files, having the ability to write those into a directory.
For example:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- file_01.yaml
- file_02.yaml
kustomize build -o target_directory will produce:
The text was updated successfully, but these errors were encountered: