I'm interested in learning whether
kpt works with generated Kubernetes manifests, and what limitations I'll likely face in trying to mate the two. I
brought this up first in the "kustomize" channel in the "Kubernetes" Slack team, as I fumbled my way through experimenting with
kpt live preview,
kpt fn source, and
kpt fn sink. My findings so far confused me, so I'd like to explore the topic further here.
I've had good experience using tools like Jsonnet to prepare Kubernetes manifests, feeding them into tools like kubecfg, qbec, or tanka. Knitting these together with Bazel, it's possible to generate and transform inputs that feed either into tools like those or even just kubectl apply -f -, throwing away the generated content and storing only the primary source in the VCS. The kpt live command family appears to want to take a directory of files as input, as opposed to being able to read from standard input, expecting that we've committed our manifests there as input, or maybe just dumped the generated output there. There's also a lot of documentation about how kpt fn can transform or generate manifests, but it's not clear to me whether we're supposed to dump its output to files and commit those to the VCS.
I'd appreciate talking through an example that includes taking a generating tool like jsonnet (but it doesn't have to be that one, just something that can spit out JSON or YAML either to standard output or to files) and integrating that with kpt live. Should this involve kpt fn? If so, how?
I also learned of two potential stumbling blocks: