Skip to content
Latchkey

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.yaml

Common 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

  1. Add the base directory to the overlay resources: list.
  2. Keep patches separate; they modify accumulated resources.
  3. Rebuild and confirm the base resources appear.
kustomization.yaml
resources:
  - ../base
patches:
  - path: replica-patch.yaml

Include reusable components

List components under components: so their added resources are part of the build.

kustomization.yaml
components:
  - ../../components/monitoring

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →