You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use variables in the ConfigMap of my base overlay, variables which will be set differently in each overlay.
The folder structure is something along the lines of:
When I run build in the base folder, the result is as expected:
# Result in service-a-configmap
FOO_VAR: "something-per-overlay-$(ENV_NAME)-stuff"
...
# Result in base-configmap:
BAR_VAR: "per-overlay-$(ENV_NAME)-stuff"
I want to replace the $(ENV_NAME) with a different value in each overlay. dev-configmap:
And when running build from the dev overlay, my desired result is:
# Result in service-a-configmap
FOO_VAR: "something-per-overlay-dev-stuff"
...
# Result in base-configmap:
BAR_VAR: "per-overlay-dev-stuff"
But what I get is:
# Result in service-a-configmap
FOO_VAR: "something-per-overlay-$(ENV_NAME)-stuff" # <-- nothing changed
...
# Result in base-configmap:
BAR_VAR: "per-overlay-dev-stuff" # <-- changed as expected
There are 14 services in the base overlay, there are 13 values in the base-configmap that contain the $(ENV_VAR) (and other 2 similarly used variables), these values are used in most services (mostly as values in their respective ConfigMaps).
I don't think replacements is a good fit for my use-case.
I tried using patches in the dev overlay (by changing the name of the ConfgiMap to base-configmap too) to no avail.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to use variables in the
ConfigMap
of my base overlay, variables which will be set differently in each overlay.The folder structure is something along the lines of:
I will describe more-or-less each relevant file to explain my question better:
service-a-configmap.yaml
:--
base-configmap
:base/kustomization
:When I run
build
in the base folder, the result is as expected:I want to replace the
$(ENV_NAME)
with a different value in each overlay.dev-configmap
:And when running
build
from the dev overlay, my desired result is:But what I get is:
Here's the
dev/kustomization
I'm trying to use:What am I missing? Is this even possible?
There are 14 services in the
base
overlay, there are 13 values in thebase-configmap
that contain the$(ENV_VAR)
(and other 2 similarly used variables), these values are used in most services (mostly as values in their respectiveConfigMap
s).I don't think
replacements
is a good fit for my use-case.I tried using
patches
in thedev
overlay (by changing the name of theConfgiMap
tobase-configmap
too) to no avail.Beta Was this translation helpful? Give feedback.
All reactions