You're right that's one of the limitations of the generators (both Secret and ConfigMap): They can only update resources included in their kustomization.yml
file. By the way it works even if the resources included themselves include other resources.
For example, having a base
, overlayA
that include the base
and overlayB
that includes overlayA
:
- any secret generated in the
base
will update its references on any resources created by the base
- any secret generated in
overlayA
will update references in resources created in overlayA
and base
- finally any secret generated in
overlayB
will update references in base
, overlayA
and overlayB
Personally, I try to keep all my secrets in the "highest" overlay, since in general they might need to be passed across overlays and are environment dependent anyway.