Is there any way in Kustomize to reference a secret, which has been generated and is used in my base, to another resource (e.g. Deployment or StatefulSet) in my overlay? I face the problem, that all occurences of the secrets name are replaced by the hashed name only in the base and not in my overlay.
I guess that there is now way around this problem, but maybe someone has a hint for me.
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 abase
,overlayA
that include thebase
andoverlayB
that includesoverlayA
:base
will update its references on any resources created by thebase
overlayA
will update references in resources created inoverlayA
andbase
overlayB
will update references inbase
,overlayA
andoverlayB
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.