kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
11.07k stars 2.26k forks source link

Show dependencies of a kustomization #5789

Open mbrt opened 1 month ago

mbrt commented 1 month ago

Eschewed features

What would you like to have added?

Given a kustomization.yaml file, I would like to use an API in kustomize that tells me which kustomizations this file depends on and which local files.

Why is this needed?

In my current company, we have a large repository containing Kubernetes configuration for ~hundreds of applications in ~hundreds of environments using Kustomize. Dependencies between overlays, components, patches grew hairy and take many minutes (>30) to build.

We are trying to:

Can you accomplish the motivating task without this feature, and if so, how?

We can iterate over all overlays and run kustomize build for all of them, before and after a change is applied. This has a couple of problems:

What other solutions have you considered?

I'm trying to implement this myself, but it's quite cumbersome and not future-proof. Parsing a kustomization file is easy, but maintaining the mapping between all its fields and whether they may or may not point to a file or kustomization directory is prone to being incomplete.

Anything else we should know?

It seems that KustTarget contains all the logic of what to load, where to load it from, etc. From a superficial overview, it seems that:

Feature ownership

k8s-ci-robot commented 1 month ago

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.