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.
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.
resources:
- ../../base
- deployment.yaml
- service.yamlBuild from the overlay directory
Point the build at the directory that holds the kustomization so relative paths resolve.
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.