Stop Building Every kustomization.yaml in CI
You have a GitOps repo. It has 35 kustomization.yaml files across clusters, components, demos, and tests. You want CI to validate that your manifests actually build. Simple enough — run kustomize build on each one and fail the pipeline if anything breaks.
Except it’s not that simple.
The Problem There are three obvious approaches, and they all have problems.
Build everything. Walk the repo, find every kustomization.yaml, build it. This breaks immediately. Most kustomization files are intermediates — bases and components that aren’t designed to build standalone. A base might define a Deployment without a namespace. A component might use patches that only make sense when composed into an overlay. Building these directly gives you cryptic errors: duplicate resources, missing targets, undefined transformers.