Flux Kustomization "kustomize build failed" in CI
kustomize-controller ran kustomize build on the path and it failed. A resource listed in kustomization.yaml is missing, a patch target does not exist, or the YAML is invalid, so no manifest set could be produced.
What this error means
A Kustomization reports "False" with "kustomize build failed" often followed by "accumulating resources" and the file it could not read or parse.
kustomize build failed: accumulating resources: accumulation err='accumulating resources from 'deployment.yaml': evalsymlink failure ...': must build at directory: not a valid directory: evalsymlink failureCommon causes
A resource listed in kustomization.yaml is missing
The resources: list names a file or directory that does not exist at the built path, so accumulation fails before any output.
An invalid patch or malformed YAML
A patch targets a resource that is not present, or a manifest has a syntax error, so kustomize cannot build the overlay.
How to fix it
Build the overlay locally to find the bad file
- Run
kustomize buildon the same path CI uses to reproduce the error. - Fix the missing resource path or the invalid patch target.
- Commit and reconcile the Kustomization.
kustomize build ./clusters/prod
flux reconcile kustomization apps --with-sourceConfirm spec.path points at the overlay
Make sure spec.path in the Kustomization points at the directory that contains a valid kustomization.yaml.
kubectl -n flux-system describe kustomization appsHow to prevent it
- Run
kustomize buildin CI before merging so build errors surface early. - Keep
resources:entries in sync with the files in the directory. - Validate patch targets exist in the base before adding overlays.