kustomize base resource missing from overlay build in CI
When an overlay build is missing a resource you expect, the overlay usually failed to include the base (or component) under resources:/components:. kustomize only accumulates what a kustomization explicitly references.
What this error means
kustomize build on an overlay produces fewer resources than expected, or a later apply misses an object, because the base was never referenced by the overlay.
kustomize
# overlays/prod/kustomization.yaml references only a patch, not the base,
# so the base Deployment never appears in the built output
patches:
- path: replica-patch.yamlCommon causes
The overlay does not reference the base
The overlay lists patches but no resources: - ../base, so kustomize has nothing to accumulate and patch.
A component was not listed
A reusable component that adds resources was omitted from components:, so its resources are absent.
How to fix it
Reference the base under resources
- Add the base directory to the overlay
resources:list. - Keep patches separate; they modify accumulated resources.
- Rebuild and confirm the base resources appear.
kustomization.yaml
resources:
- ../base
patches:
- path: replica-patch.yamlInclude reusable components
List components under components: so their added resources are part of the build.
kustomization.yaml
components:
- ../../components/monitoringHow to prevent it
- Always reference the base under
resources:in overlays. - List every component the overlay depends on.
- Build overlays in CI and diff the resource count against expectations.
Related guides
kustomize "accumulating resources ... no such file or directory" in CIFix kustomize "accumulating resources ... no such file or directory" in CI - a resources entry points at a fi…
kustomize "found conflict between ..." duplicate resource in CIFix kustomize "may not add resource with an already registered id" / "found conflict" in CI - two resources w…
kustomize "no matches for ... " patch target in CIFix kustomize "no matches for Id ..." in CI - a patch or transformer targets a resource by name/kind that doe…