-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replacement not working with overlay configmap values #4795
Comments
@ferronsw: This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @ferronsw, I get the same behavior on my mac, but this isn't a bug. Kustomize is designed to run the generators and transformers in each layer only once on the resources available at the time of run. In your case, To get an "up-to-date" ExternalSecret, you can move the |
I'm facing the same situation. I guess it is intuitive to override configs in overlays and assume that the base replacements will do their job as intended. Including the replacements in each overlay removes the whole point of having overlays to start with. Or am I getting this completely wrong? I was so excited hoping that I could finally have a way to provide simple config overrides in overlays and let the base take care of distributing these values. It seems that Kustomize is not just disallowing templating, but also anything close to it xD |
I think I just came much closer to what is intended. The base should be divided into
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ex-secret.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- config-replacements.yaml
apiVersion: builtin
kind: ReplacementTransformer
metadata:
name: not-important-patch-ingress-mcert
replacements:
# ... they go here
In the overlay, we would then import resources, generate config, and finally run transformers. apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base/resources
configMapGenerator:
- name: test
behavior: replace
envs:
- env.properties
transformers:
- ../base/transformers The overlay is minimal and works as expected since transformers run last. There is part of the documentation that mentions this layout, but no concrete example of using the built-ins. |
@nourspace I have almost the same solution in place now.
The replacements are located in the base folder.
The only thing is you need to specify:
|
Describe the bug
I have the following base/kustomization.yaml where I'm doing some replacements:
The base/env.properties file in the base contains the following properties and values:
base/ex-secret.yaml file for reproduce:
Now I have created an overlay overlay/kustomization.yaml to overwrite the values like
overlay/env.properties:
File tree:
Expected output
I would expect testen, testen2 and testen3 to show up in the output.
Actual output
But I'm still getting the base values in the output.
Kustomize version
v4.5.7
Platform
Windows
The text was updated successfully, but these errors were encountered: