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.ymlfile. By the way it works even if the resources included themselves include other resources. For example, having abase,overlayAthat include thebaseandoverlayBthat includesoverlayA:basewill update its references on any resources created by thebaseoverlayAwill update references in resources created inoverlayAandbaseoverlayBwill update references inbase,overlayAandoverlayBPersonally, 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.