Kustomize
Hard
Mutation
An overlay lists two components: first one that sets nameSuffix: -b, then one that adds a Deployment named proxy. What is the Deployment called after the build?
Select your answer:
Show answer and explanation
Answer: proxy, because the suffix ran before the Deployment was added
Explanation
Components run one at a time in list order, and each one applies its transformers to the resources gathered so far. The suffix component runs while proxy doesn't exist yet, so only earlier resources get -b. List the suffix component last, or set nameSuffix in the overlay itself, to rename everything.
More hard Kustomize questions
- Why can a component patch resources defined in the overlay that includes it, when a base can't?
- Which field path selects the value of the env var SERVICE_HOST in the container named app, for a replacement target?
- A production overlay lists a remote base with ?ref=main. What's the risk?
- A strategic merge patch adds one item to a list in a custom resource, but the build replaces the whole list. Why?
- A custom resource refers to a generated ConfigMap by name, but after the build it still uses the name without the hash suffix. Why?
- An overlay's configMapGenerator uses the same name as one generated in the base, with no behavior set. What happens?