kustomize "accumulating resources ... no such file or directory" in CI
kustomize build walked your resources: list and one entry does not exist on disk. It reports the accumulation error with the path it tried, whether a manifest file or a base directory.
What this error means
kustomize build or kubectl apply -k fails with "Error: accumulating resources: ... : no such file or directory" naming the missing path.
kustomize
Error: accumulating resources: accumulation err='accumulating resources from
'deployment.yaml': open /repo/overlays/prod/deployment.yaml: no such file or directory'Common causes
A resource path is wrong or the file is uncommitted
The resources: entry names a file or base that was renamed, moved, or never committed, so it is absent in CI.
The build runs from the wrong directory
Relative resource paths resolve from the kustomization directory; running the build elsewhere breaks them.
How to fix it
Correct the resource path
- Confirm the file or base directory exists at the referenced path.
- Fix the
resources:entry to a path relative to kustomization.yaml. - Commit any missing file so it is present in CI.
kustomization.yaml
resources:
- ../../base
- deployment.yaml
- service.yamlBuild from the overlay directory
Point the build at the directory that holds the kustomization so relative paths resolve.
Terminal
kustomize build overlays/prodHow to prevent it
- Keep resource paths relative to kustomization.yaml.
- Run
kustomize buildon each overlay in CI to catch missing files. - Commit every referenced base and manifest.
Related guides
kustomize build "evalsymlink failure" in CIFix kustomize "evalsymlink failure" in CI - kustomize could not resolve a path because it does not exist or a…
kustomize "unable to find one of kustomization.yaml" in CIFix kustomize "unable to find one of kustomization.yaml" in CI - the target directory has no kustomization fi…
kustomize base resource missing from overlay build in CIFix kustomize where a base resource does not appear in the overlay output in CI - the overlay did not include…